Use C++ Language Create a program that will calculate and print to the screen a sales receipt. Required: 1. First 3 lines of code will be three comment lines a. Name of the cpp file b. Why you are doing this program 2. The user will enter in the number of sales items 3. The user will enter in the price for each item 4. The user will enter in the sales tax percentage 5. Output a. Title for the output b. Money amount have 2 decimal point places c. Money amount to be aligned d. Boarder around the output 6. The user will have the ability to run this program again. The figure below should be used as an EXAMPLE and you should follow the format of the receipt.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section1.3: Preliminary Three: Software Development
Problem 7E: (Statistics) This is the formula for the standard normal deviate, z, used in statistical...
icon
Related questions
Question

Use C++ Language

Create a program that will calculate and print to the screen a sales receipt.
Required:
1. First 3 lines of code will be three comment lines
a. Name of the cpp file
b. Why you are doing this program
2. The user will enter in the number of sales items
3. The user will enter in the price for each item
4. The user will enter in the sales tax percentage
5. Output
a. Title for the output
b. Money amount have 2 decimal point places
c. Money amount to be aligned
d. Boarder around the output
6. The user will have the ability to run this program again.
The figure below should be used as an EXAMPLE and you should follow the format of the receipt.

## Sales Tax Calculation Program

### Program Interface and Operation

#### User Input
1. **Sales Items Count**:
   - The user is prompted with the message: `How many sales items do you have?` 
   - In this run, the user entered `3`.

2. **Sales Item Values**:
   - The user is prompted to enter the value of each sales item:
     - `Enter in the value of sales item 1: $10`
     - `Enter in the value of sales item 2: $10`
     - `Enter in the value of sales item 3: $10`

3. **Sales Tax Percentage**:
   - The user is prompted to enter the sales tax percentage:
     - `Enter in the sales tax percentage`
     - `Enter 10 for 10%: 6`

#### Output
After the inputs are provided, the program calculates the total sales, the sales tax, and the grand total. The output is displayed in a formatted receipt:

```
   ***************************
   *     SALES RECEIPT       *
   ***************************
   *  Total Sales   $ 30.00  *
   *  Sales tax     $  1.80  *
   *  Grand Total   $ 31.80  *
   ***************************
```

- **Total Sales**: Sum of all item values entered by the user. In this case, `10 + 10 + 10 = $30.00`.
- **Sales Tax**: The sales tax is calculated as `Total Sales * (Sales Tax Percentage/100)`. Here, it is `$30 * 6/100 = $1.80`.
- **Grand Total**: The sum of total sales and the calculated sales tax. Here, it is `$30.00 + $1.80 = $31.80`.

#### Program Loop
Finally, the program asks the user if they want to run the program again:
- `Do you want to run this program again? (Y/N):`

### Summary
This program demonstrates a simple interactive console application where the user inputs item prices and a sales tax rate, and receives a formatted receipt showing the total sales, sales tax, and grand total. This can be a useful practice for beginners learning basic input/output operations and arithmetic calculations in C++.
Transcribed Image Text:## Sales Tax Calculation Program ### Program Interface and Operation #### User Input 1. **Sales Items Count**: - The user is prompted with the message: `How many sales items do you have?` - In this run, the user entered `3`. 2. **Sales Item Values**: - The user is prompted to enter the value of each sales item: - `Enter in the value of sales item 1: $10` - `Enter in the value of sales item 2: $10` - `Enter in the value of sales item 3: $10` 3. **Sales Tax Percentage**: - The user is prompted to enter the sales tax percentage: - `Enter in the sales tax percentage` - `Enter 10 for 10%: 6` #### Output After the inputs are provided, the program calculates the total sales, the sales tax, and the grand total. The output is displayed in a formatted receipt: ``` *************************** * SALES RECEIPT * *************************** * Total Sales $ 30.00 * * Sales tax $ 1.80 * * Grand Total $ 31.80 * *************************** ``` - **Total Sales**: Sum of all item values entered by the user. In this case, `10 + 10 + 10 = $30.00`. - **Sales Tax**: The sales tax is calculated as `Total Sales * (Sales Tax Percentage/100)`. Here, it is `$30 * 6/100 = $1.80`. - **Grand Total**: The sum of total sales and the calculated sales tax. Here, it is `$30.00 + $1.80 = $31.80`. #### Program Loop Finally, the program asks the user if they want to run the program again: - `Do you want to run this program again? (Y/N):` ### Summary This program demonstrates a simple interactive console application where the user inputs item prices and a sales tax rate, and receives a formatted receipt showing the total sales, sales tax, and grand total. This can be a useful practice for beginners learning basic input/output operations and arithmetic calculations in C++.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning