Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago