
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
thumb_up100%

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 6 images

Knowledge Booster
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
- use pseudocode in designing the logic Design an application for Bob’s E-Z Loans. The application accepts a client’s loan amount and monthly payment amount. Output the customer’s loan balance each month until the loan is paid off.arrow_forwardDon't you dare give me AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forwardI am creating a c++ snakes and ladders game (no visuals). I want the game to have up to 5 or 6 players. For the snakes/ladders I am going to create a function which needs the dice roll and adds it to the score which will then decide if the player has landed on a snake or a ladder, is there any way I can get all players scores to be stored in the “score” variable in the switch statements without using multiple switch statements? So I basically want a switch statement which can accommodate all 1-6 players . E.g p1 initially at 1 rolls a 4. So their new score is 1+4=5, then the switch function checks for a ladder or snake. Then player 2 who's initially a 2 rolls a 5, so their new score is 2+5=7 then THE SAME switch function checks for a snake or ladder... And so on for all other players.arrow_forward
- Create a program flowchart for van dispatching process. Assume that you are in the van terminal. The passenger of the van comes with an unknown number. The van driver will wait until the passenger becomes 20.arrow_forwardWrite a C# program that asks the user for a starting value, and ending value, and an increment. Your program should then output all the values from the starting value to the ending value (inclusive) in the increment specified. The output in the program should be a label indicating the start, end and increment, and then each of the numbers in the range on a single line of output. Your numbers should be output such that there are three digits to the right of the decimal point. Test your program with (a) Start Value: ‐13, End Value: 42, Increment 3.1415 and (b) Start Value: ‐5, End Value: 5, Increment .5arrow_forwardYou are burning some music CDs for a party. You have arranged a list of songs in the order youwant to play them. However, you would like to maximize your use of space on the CD, whichholds 80 minutes of music. To do so, you want to figure out the total time for a group of songsand see how well they fit. Write a design and a C++ program to help you accomplish this task.The data are on file “songs.txt” (which is provided for you). The time is entered as seconds. Forexample, if a song takes 7 minutes and 42 seconds to play, the data entered for that song wouldbe 462.After all the data has been read, the application should print a message indicating the timeremaining on the CD. The output must be in the form of a table with columns and headingswritten on a file. For example: (see image) Note: the output converts the input from seconds to minutes and seconds. Use meaningfulvariable names, proper indentation, and appropriate comments. Thoroughly test the programusing your own data sets.Use…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education