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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education