Question: Using C++ Write a program that lets a maker of chocolate candy keep track of sales for four different types of salsa, numbered 0 through
Using C++
Write a program that lets a maker of chocolate candy keep track of sales for four different types of salsa, numbered 0 through 3. The sales amounts for each candy type during the days of a week (Monday through Saturday) are stored in a data file named candy.txt as shown below:
1856.43 386.54 785.34 1043.60 1534.87 2544.66
847.50 1290.54 1506.80 899.65 1440.65 3006.99
1092.65 689.54 987.65 1024.35 1024.28 2905.76
5698.54 7699.54 2345.67 2956.87 7743.98 9278.54
Write a program to read the file into a 2D array of float or double values, then calculate and display the following statistics for the data:
=> The sales for each candy type.
=> The sales for each day of the week.
=> The total sales for the company during the week.
The program should be modular. You should have separate functions for input and output, with separate functions to calculate each statistic. Your output should be well-organized, neat, and easy to read.
Input Validation: Print an error message and set the item to 0 if it is less than 0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
