Problem

Construct a solution algorithm for the following programming problems. To obtain your fi...

Construct a solution algorithm for the following programming problems. To obtain your final solution, you should:

• define the problem

• group the activities into modules (also consider the data that each module requires)

• construct a hierarchy chart

• establish the logic of the mainline using pseudocode

• develop the pseudocode for each successive module in the hierarchy chart

• desk check the solution algorithm.

Design an algorithm that will read a customer file and calculate the percentage discount allowed on a customer’s purchase. Each input record contains the customer’s number and name, the class code and the number of units purchased. For wholesale customers,the input record also contains the distance from the warehouse. The class code contains either ‘R’ for retail customers or ‘W’ for wholesale customers. The end-of-file is denoted by a customer number of 99999.

Your program is to read the customer file and determine the percentage discount, if any, on a customer’s purchase, according to the following guidelines. Retail customers do not receive any discount, nor do wholesale customers who purchase fewer than 10 units. A 10% discount is given to wholesale customers who purchase at least 10 but fewer than 30 units and are within 50 kilometres of the distributor’s warehouse. If a wholesale customer purchases between 10 and 30 units but is more than 50 kilometres away, only a 5% discount is allowed. Wholesale customers who purchase 30 or more units receive a 15% discount if they are within 50 kilometres of the warehouse, and a 10% discount if they are more than 50 kilometres away.

Print a detail line for each customer, listing the customer’s number and name, the class code, the number of units purchased and the percentage discount (if any) to be applied.

Print headings and column headings at the top of each page, allowing for 45 detail lines per page.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 10
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT