Lecture notes for the Introduction to Computer Science for non-majors by James Tam Return to the course web page

Point of sale program

  1. The program will ask the cashier to enter in the price of an item and it will display breakdowns for the retail price, the amount of sales tax and the total amount owing.  The tax rate is equal to 7% and the total amount owing is equal to the retail price plus the amount of sales tax. 
  2. After this the program should prompt the cashier for the amount paid by the customer and display the amount of change that is owing.
  3. Note: You cannot make arbitrary assumptions about the ranges of the dollar value for each transaction.  Monetary values will be displayed in dollar values with cents being stored and displayed as fractions of a dollar.  Your program must display the fractional dollar values to a maximum of two decimal places.