Produce Sales Report

Objective

  • Define the problem by constructing an algorithm using pseudocode
  • Create an IPO diagram showing input, output, and processing steps
  • What control structures (sequence, selection and repetition) are required?
  • What variables are required?
  • Show a check of your solution with test data for at least two valid test cases

Design a program that will read a file of sales records and produce a sales report. Each record in the file contains a customer's number and name, a sales amount and a tax code. The tax code is to be applied to the sales amount to determine the sales tax due for that sale, as follows:

 

Tax Code Sales Tax
0 tax exempt
1 3%
2 5%

The report must print a heading, "Sales Report", followed by detail lines. Each detail line must list the customer number, name, sales amount, sales tax and the total amount due.