4152 Words May 21st, 2014 17 Pages
Programming Logic and Design, 6e

Solutions 6-1

Programming Logic and Design, 6th Edition
Chapter 6
Exercises
1.

a. Design the logic for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their entry.

A sample solution follows
Flowchart:

Pseudocode: start Declarations num index num SIZE = 10 num numbers[SIZE] = 0,0,0,0,0,0,0,0,0,0 getReady() Programming Logic and Design, 6e

Solutions 6-2

while index < SIZE getNumbers() endwhile finishUp() stop getReady() index = 0 return getNumbers() output “Enter a number for position ”, index input numbers[index] index = index + 1 return finishUp() output “The numbers in reverse order are: ” while index >
Flowchart:

Programming Logic and Design, 6e

Pseudocode: start Declarations num age num income num x string gender string maritalStatus num SIZE = 5 num ageCnt[SIZE] = 0

Solutions 6-32

Programming Logic and Design, 6e

Solutions 6-33

num AGE_RANGE[SIZE] = 0, 20, 30, 40, 50 string AGE_GROUPS[SIZE] = “under 20”, “20 through 29”,
“30 through 39”, “40 through 49”,
“50 and older” getReady() while not eof detailLoop() endwhile finishUp() stop getReady() output “Enter the age, gender, marital status, and income of a reader” input age, gender, maritalStatus, income return detailLoop() x = SIZE – 1 while age < AGE_RANGE[x] x = x – 1 endwhile ageCnt[x] = ageCnt[x] + 1 output “Enter the age, gender, marital status, and income of a reader” input age, gender, maritalStatus, income return finishUp() x = 0 while x < SIZE output AGE_GROUPS[x], ageCnt[x] x = x + 1 endwhile return

b. Modify the Daily Life Magazine program so that it produces a count of readers by gender within age group—that is, under 20 females, under 20 males, and so on.
Flowchart:

Programming Logic and Design, 6e

Pseudocode: start Declarations num age num income num x string gender string maritalStatus num SIZE = 5

Solutions 6-34

Programming Logic and Design, 6e

Solutions 6-35

num maleCnt[SIZE] = 0

Related Documents

• Chapter 6 Solutions To Assigned Exercises Essay

CHAPTER 6 MASTER BUDGET AND RESPONSIBILITY ACCOUNTING 6-16 (15 min.) Sales budget, service setting. In 2014, Rouse & Sons, a small environmental-testing firm, performed 12,200 radon tests for \$290 each and 16,400 lead tests for \$240 each. Because newer homes are being built with leadfree pipes, lead-testing volume is expected to decrease by 10% next year. However, awareness of radon-related health hazards is expected to result in a 6% increase in radon-test volume each year in the near future.…

Words: 2193 - Pages: 9
• Essay on Chapter 6 Hoyle 12ed

Chapter 6 Variable interest entities, Intra-entity Debt, Consolidated Cash flows, and Other Issues Chapter Outline I. Variable interest entities (VIEs) A. VIEs typically take the form of a trust, partnership, joint venture, or corporation. In most cases a sponsoring firm creates these entities to engage in a limited and well-defined set of business activities. For example, a business may create a VIE to finance the acquisition of a large asset. The VIE purchases the asset using…

Words: 13931 - Pages: 56
• Essay on Finance Chapter 6

Chapter 6 Bonds and their Valuation OVERVIEW This chapter presents a discussion of the key characteristics of bonds, and then uses time value of money concepts to determine bond values. Bonds are one of the most important types of securities to investors, and are a major source of financing for corporations and governments. The value of any financial asset is the present value of the cash flows expected from that asset. Therefore, once the cash flows have been estimated, and…

Words: 6903 - Pages: 28
• Essay Chapter 6 : Summary And Conclusion

CHAPTER 6 – SUMMARY AND CONCLUSION 6.1 SUMMARY & CONCLUSION In her quest to tackle the issue of poverty in Ghana, and further build upon her achievement of being the first country in the West African sub region to meet MDG 1, the Government of Ghana has rolled out a number of social interventions and policies aimed at alleviating poverty. As part of its measures, the Government in 2007…

Words: 1342 - Pages: 6
• Chapter 7 Solutions Essay

problem they have been experiencing is that the backups are taking longer and longer. What is your recommendation for this company? Answer: b. Use a custom backup that enables you to use a combination of full and incremental backups. 6. Dynamic disks support RAID levels _____, _____, and _____. Answer: 0, 1, and 5. 7. You are consulting for an organization that has chosen to use disk striping as a way to extend the life of their four hard disks. Now one of the disks…

Words: 2911 - Pages: 12
• Essay Chapter 2 Solutions

CHAPTER 2 The Financial Statements BRIEF EXERCISES BE2–1 2008 2008 2008 Beginning Ending Retained 2008 2008 2008 Retained Earnings + Revenues – Expenses – Dividends = Earnings \$28.2 + \$43.3 – \$38.2 – X = \$30.6 X = \$2.7 2008 Dividends as a percentage of 2008 net income: 2008 Dividends = \$ 2.7 = 52.9% 2008 Net income (\$43.3-\$38.2) \$ 5.1 BE2–2 1) Current Liabilities financed \$32 billion of the…

Words: 7494 - Pages: 30
• Essay Chapter 6 International Parity Relationships

CHAPTER 6 INTERNATIONAL PARITY RELATIONSHIPS AND FORECASTING FOREIGN EXCHANGE RATES ANSWERS & SOLUTIONS TO END-OF-CHAPTER QUESTIONS AND PROBLEMS PROBLEMS 1. Suppose that the treasurer of IBM has an extra cash reserve of \$100,000,000 to invest for six months. The six-month interest rate is 8 percent per annum in the United States and 7 percent per annum in Germany. Currently, the spot exchange rate is €1.01 per dollar and the six-month forward exchange rate is €0.99 per dollar. The treasurer of…

Words: 1653 - Pages: 7
• Essay Chapter 6 Of The Nicomachean Ethics

Aristotle defines many virtues in his book, Nicomachean Ethics. A virtue, as defined by Book II Chapter 6 of the Nicomachean Ethics, is a state of being where one acts in the mean, acting in moderation, relative to two vices, two extremes, and within reason according to the prudent person (Aristotle 1107a1). One virtue that he speaks to is the virtue of temperance. In the given scenario, Jerry does not practice temperance, but he is incontinent, lacking self-control, because he lies to his boss,…

Words: 827 - Pages: 4
• Essay Solutions for Mcdonald Chapter 6

Chapter 6 Commodity Forwards and Futures Question 6.1. The spot price of a widget is \$70.00. With a continuously compounded annual risk-free rate of 5%, we can calculate the annualized lease rates according to the formula: F0,T = S0 × e(r−δl )×T ⇔ F0,T S0 = e(r−δl )×T S0 = (r − δl ) × T F0,T 1 ln T S0 ⇔ ln F0,T ⇔ δl = r − Time to expiration Forward price Annualized lease rate 3 months \$70.70 0.0101987 6 months \$71.41 0.0101147 9 months \$72.13 0.0100336 12 months \$72.86 0.0099555 The…

Words: 2816 - Pages: 12
• Essay Chapter 4 Solutions

Chapter 04 Analyzing Investing Activities Multiple Choice Questions 1. Which of the following would rarely be classified as a current asset? A. Prepaid insurance B. Goodwill C. Marketable Securities D. Work-in-progress 2. Which of the following would not be classified as a current asset? A. Inventory B. Accounts payable C. Accounts receivable D. Prepaid expenses 3. An asset is considered to be liquid if: A. it is readily converted into a current asset. B. it is…

Words: 3092 - Pages: 13