Programming logic and design, 6th edition

Draw a typical hierarchy chart for a paycheck-producing program. Try to think of at least 10 separate modules that might be included. For example, one module might calculate an employee’s dental insurance premium.

 

 

5 . Draw the hierarchy chart and then plan the logic for a program for the sales manager of The Couch Potato Furniture Company. The manager needs a program to determine the profit on any item sold. Input includes the wholesale price and retail price for an item. The output is the item’s profit, which is the retail price minus the wholesale price. Use three modules. The main program declares global variables and calls housekeeping, detail, and end-of-job modules. The housekeeping module prompts for and accepts a wholesale price. The detail module prompts for and accepts the retail price, computes the profit, and displays the result. The end-of-job module displays the message “Thanks for using this program”.

 

 

6. a. Draw the hierarchy chart and then plan the logic for a program that calculates the gown size a student needs for a graduation ceremony. The program uses three modules. The first prompts a user for and accepts the student’s height in inches. The second module accepts the student’s weight in pounds and converts the student’s height to centimeters and weight to grams. Then, it calculates the graduation gown size needed by adding 1/3 of the weight in grams to the value of the height in centimeters. The program’s output is the gown size the student should order. There are 2.54 centimeters in an inch and 453.59 grams in a pound. Use named constants wherever you think they are appropriate. The last module displays the message “End of job”.

 

b. Revise the size-determining program to execute continuously until the user enters 0 for the height in inches.

 

7. Draw the hierarchy chart and design the logic for a program that contains housekeeping, detail loop, and end-of-job modules, and that calculates the service charge customers owe for writing a bad check. The main program declares any needed global variables and constants and calls the other modules. The housekeeping module displays a prompt for and accepts a customer’s last name. While the user does not enter “ZZZZ” for the name, the detail loop accepts the amount of the check in dollars and cents. The service charge is computed as $20 plus 2 percent of the check amount. The detail loop also displays the service charge and then prompts the user for the next customer’s name. The end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.

 

 

8. Draw the hierarchy chart and design the logic for a program for the owner of Bits and Pieces Manufacturing Company, who needs to calculate an employee’s projected salary following a raise. The input is the name of the employee, the employee’s current weekly salary, and the percentage increase expressed as a decimal (for example, 0.04 for a 4 percent raise). Design the program so that it runs continuously for any number of employees using three modules. The housekeeping module prompts the user for the percent raise that will be applied to every employee, and prompts for the first employee’s name. The detail loop executes continuously until the user enters “XXX” for the employee’s name. The detail loop gets the employee’s weekly salary, applies the raise, produces the result, and prompts for the next employee name. The end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.

 

9. Draw the hierarchy chart and design the logic for a program for the manager of the Jeter County softball team, who wants to compute batting averages for his players. A batting average is computed as hits divided by at-bats, and is usually expressed to three decimal positions (for example, .235). Design a program that prompts the user for a player jersey number, the number of hits, and the number of at-bats, and then displays all the data, including the calculated batting average. The program accepts players continuously until 0 is entered for the jersey number. Use appropriate modules, including one that displays “End of job” after the sentinel is entered for the jersey number.

 

10. Create a flowchart or pseudocode that shows the logic for a program that generates a random number, then asks the user to think of a number between 1 and 10. Then display the randomly generated number so the user can see whether his or her guess was accurate. (In future chapters you will improve this game so that the user can enter a guess and the program can determine whether the user was correct.)

 

11. Many programming style guides are published on the Web. These guides suggest good identifiers, explain standard indentation rules, and identify style issues in specific programming languages. Find style guides for at least two languages (for example, C++, Java, Visual Basic, or C#) and list any differences you notice.

 

12. In this chapter, you learned the term mnemonic, which is a memory device like the sentence “Every good boy does fine.” Another popular mnemonic is “May I have a large container of coffee?” What is its meaning? Have you learned other mnemonics as you have studied various subjects? Describe at least five other mnemonics that people use for remembering lists of items.

 

13. What advantages are there to requiring variables to have a data type?

 

14. Would you prefer to write a large program by yourself, or work on a team in which each programmer produces one or more modules? Why?

 

15. Extreme programming is a system for rapidly developing software. One of its tenets is that all production code is written by two programmers sitting at one machine. Is this a good idea? Does working this way as a programmer appeal to you? Why or why not?

 

 

Punctual Essays
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.