Question
C++ b.) (Lab1c.cpp) Write Lab1c.cpp in the following order. Define variables for storing the expense information of a week Define variables to hold the following
C++
b.) (Lab1c.cpp) Write Lab1c.cpp in the following order.
Define variables for storing the expense information of a week
Define variables to hold the following expenses: 45.25, 49.38, 12.75, 123.50, 8.25, 19.95, and 145.70.
Define variables to hold the days for the expenses. Define a variable to be used for holding the sum of the expenses. Define a variable to be used for holding the average of the expenses.
Analyze the information
Compute the total of these expenses using the variables holding the expenses and store the result in the variable for holding the sum of the expenses.
Compute the average of these expenses using the variables holding the expenses and store the result in the variable for holding the average of the expenses.
Create a report
Display the contents of the variables holding the expense information to the screen one expense per line. You must use those variables holding the expense days for the reporting code.
You must use meaningful names for the variables. For example, use weekDay1 for storing the expense day information Sunday.
In the output, all numbers must display properly. The decimal points of the expense amounts, the total, and the average are aligned vertically. The output should look exactly as follows.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started