?If possibly to do it in C please or C++

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
100%
?If possibly to do it in C please or C++
Your program should be called salesAnalyzer.c and should run as follows:
1. It should prompt the user to enter daily sales for a week (7 days).
2. It should validate the entries as follows:
o Sales should not be negative.
o Sales should be within a reasonable range, between $0 and $5000 per day.
3. It should record the sales for each day using an array.
4. It should record the highest sales and the day it occurred.
5. It should record the lowest sales and the day it occurred.
6. It should calculate the total sales, average daily sales, and average sales overall.
7. At the end, it should report the following:
o The total sales for the week.
o The average daily sales.
o The highest sales and the day it occurred.
o The lowest sales and the day it occurred.
Sample code that uses arrays with for-loops can be seen at Lab2Sample.c
• Be sure to document your code with the file name, your name and student number. Add comments
throughout the code where necessary.
Sample Output
A sample run is as follows:
Weekly Sales Analyzer ===---
Enter sales for Day 1: 1200
Enter sales for Day 2: 800
Enter sales for Day 3: -100
Incorrect value, sales cannot be negative.
Enter sales for Day 3: 10500
Incorrect value, sales are too high (max $5000 per day).
Enter sales for Day 3: 2000
Enter sales for Day 4: 1500
Enter sales for Day 5: 3000
Enter sales for Day 6: 1800
Enter sales for Day 7: 2500
Total sales for the week: $12800.00
Average daily sales: $1828.57
Highest sales was $3000.00 on Day 5
Lowest sales was $800.00 on Day 2
L
Transcribed Image Text:Your program should be called salesAnalyzer.c and should run as follows: 1. It should prompt the user to enter daily sales for a week (7 days). 2. It should validate the entries as follows: o Sales should not be negative. o Sales should be within a reasonable range, between $0 and $5000 per day. 3. It should record the sales for each day using an array. 4. It should record the highest sales and the day it occurred. 5. It should record the lowest sales and the day it occurred. 6. It should calculate the total sales, average daily sales, and average sales overall. 7. At the end, it should report the following: o The total sales for the week. o The average daily sales. o The highest sales and the day it occurred. o The lowest sales and the day it occurred. Sample code that uses arrays with for-loops can be seen at Lab2Sample.c • Be sure to document your code with the file name, your name and student number. Add comments throughout the code where necessary. Sample Output A sample run is as follows: Weekly Sales Analyzer ===--- Enter sales for Day 1: 1200 Enter sales for Day 2: 800 Enter sales for Day 3: -100 Incorrect value, sales cannot be negative. Enter sales for Day 3: 10500 Incorrect value, sales are too high (max $5000 per day). Enter sales for Day 3: 2000 Enter sales for Day 4: 1500 Enter sales for Day 5: 3000 Enter sales for Day 6: 1800 Enter sales for Day 7: 2500 Total sales for the week: $12800.00 Average daily sales: $1828.57 Highest sales was $3000.00 on Day 5 Lowest sales was $800.00 on Day 2 L
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
ADT and Class
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.
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