Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
100%
### Instructions for Creating a Program for Hansen's Discount Supermarket

**Objective:**
Design a small program for Hansen's Discount Supermarket that manually tallies items purchased and calculates the tax and final total of all sales. The program needs to handle manual input due to a broken scanner. Below are the specific requirements and guidelines:

**Requirements & Specifications:**

1. **Use Two Different Arrays:**
   - **Character Array** for the welcome message. This requires predefining the message and displaying it using a loop rather than directly printing it out.
   - **Array with Float Data Type** to hold the prices of the items.

2. **Prompt User for Input:**
   - Prompt the user to enter how many items they have to total.
   - Use a loop to fill the price array with the user's inputs.

3. **Input Validation:**
   - Ensure that no item price exceeds $100.00. If it does, declare it invalid and prompt the user to enter a valid price.
   - If invalid data is entered, repeatedly ask until a valid input is given.

4. **Accumulate Total Sales:**
   - Use an accumulating total statement to compute the total sales of the items.

5. **Tax Calculation:**
   - Compute the final total of the sales including a tax of 6% (0.06).

6. **Output:**
   - Display the subtotal, tax amount, and final total to the user in a readable format.
   - Ensure to display clear error messages for invalid prices.

7. **Submission:**
   - Include three files for submission: the source file (.c), a screenshot of the program's output screen, and a flowchart file (.fmp).

**Sample Output:**
Here's an example of what the program's output looks like:

```
Welcome to Hansen's Discount Supermarket!
How many items do you have to scam: 3

We are sorry the scanner is broken at the moment.
Please enter your prices manually.

What is the price of your product: 1.24
What is the price of your product: 25.30
Invalid Price, be sure to enter a Price under $10.00
Enter a valid price: 62.45
Invalid Price, be sure to enter a Price under $10.00
Enter a valid price: 1.24
What is the price of your product: .50
Your total is 2.98
expand button
Transcribed Image Text:### Instructions for Creating a Program for Hansen's Discount Supermarket **Objective:** Design a small program for Hansen's Discount Supermarket that manually tallies items purchased and calculates the tax and final total of all sales. The program needs to handle manual input due to a broken scanner. Below are the specific requirements and guidelines: **Requirements & Specifications:** 1. **Use Two Different Arrays:** - **Character Array** for the welcome message. This requires predefining the message and displaying it using a loop rather than directly printing it out. - **Array with Float Data Type** to hold the prices of the items. 2. **Prompt User for Input:** - Prompt the user to enter how many items they have to total. - Use a loop to fill the price array with the user's inputs. 3. **Input Validation:** - Ensure that no item price exceeds $100.00. If it does, declare it invalid and prompt the user to enter a valid price. - If invalid data is entered, repeatedly ask until a valid input is given. 4. **Accumulate Total Sales:** - Use an accumulating total statement to compute the total sales of the items. 5. **Tax Calculation:** - Compute the final total of the sales including a tax of 6% (0.06). 6. **Output:** - Display the subtotal, tax amount, and final total to the user in a readable format. - Ensure to display clear error messages for invalid prices. 7. **Submission:** - Include three files for submission: the source file (.c), a screenshot of the program's output screen, and a flowchart file (.fmp). **Sample Output:** Here's an example of what the program's output looks like: ``` Welcome to Hansen's Discount Supermarket! How many items do you have to scam: 3 We are sorry the scanner is broken at the moment. Please enter your prices manually. What is the price of your product: 1.24 What is the price of your product: 25.30 Invalid Price, be sure to enter a Price under $10.00 Enter a valid price: 62.45 Invalid Price, be sure to enter a Price under $10.00 Enter a valid price: 1.24 What is the price of your product: .50 Your total is 2.98
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education