Question: Variables and Expressions - Total Purchase Total points: 2 5 Write your name, class, and assignment name on top of your program as comments. Submit

Variables and Expressions - Total Purchase
Total points: 25
Write your name, class, and assignment name on top of your program as comments. Submit your
cpp file to D2L by the due date and time.
A customer in a store is purchasing five items. The prices of the five items are:
Price of item 1=$10.95
Price of item 2=$25.95
Price of item 3=$7.95
Price of item 4=$11.95
Price of item 5=$2.95
Write a program that holds the prices of the items in five variables. Assume the sales tax
is 6%. Display each item's price, the subtotal of the sale, the amount of sales tax and the
total.
Create string variables name, className and assignment, and assign your name,
class and assignment number to these variables. (3 points)
Print your name, class and assignment name on top using the string variables you
created in step 1.(1 point)
Create a named constant and assign the tax rate 6.25%(i.e.0.0625) to it.(1 point)
Create five variables of a suitable datatype to hold decimal numbers. (5 points)
Calculate the subtotal (sum of all item prices), the tax and the total. Use the named
constant you created in step 3 for calculating the tax. (3 points)
Display all of the above, with $ signs and all. See below. (8 points)
Include proper comments in program - on top, as well as in-line. (4 points)
Your Name - CMPS 1044- Assignment 04
Item 1: $10.95
Item 2: $25.95
Item 3: $7.95
Item 4: $11.95
Item 5: $2.95
Subtotal: $59.75
Tax: $3.73438
Compile and run your program. Your program must compile and run successfully to
receive full credit for this homework.
Further grading criteria:
Program not compiling: -15 points.
Variables and Expressions - Total Purchase Total

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!