Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi my name is Diamoni and using C++ can you help me Use prototypes to declare each function at the beginning of the program Define

hi my name is Diamoni and using C++ can you help me

  • Use prototypes to declare each function at the beginning of the program
  • Define each function below the main function

Create a program that gets a users utility bill amounts for a month, calculates the total of the bills and determines the average amount of money to set aside from a weekly check (using a 4 week divisor) to cover the bills at the end of the month using functions that you will define as follows:

  1. displayMessage() this function will print a welcome message to the user that they are using the Bill Calculator program. No information is returned.
  2. inputBills() this value returning function will be passed the users name and allow the user to input three bills. Each bill must be greater than $0 and less than $500. Once three valid bill amounts have been entered, the total will be returned to the part of the program that called the function.
  3. getAvg() this function will be passed the total of the bills (by value), the total monthly income (by value), the average (by reference) and the percent (by reference). The function will calculate the average, over 4 weeks, and store it in mains average variable. It will also calculate the percentage spent on bills from the monthly income (total bills / total income).
  4. displayReport() this function will be passed the users name, the average amount to set aside and the percentage spent on bills from the monthly income. It will print the users bill calculator report along with a message to decrease bills if the percentage is greater than 10% of the income or good job if under 10%.

Sample Run

Welcome to the Bill Calculator Program

Enter the users name:

Mary Davis

Enter the users monthly income:

$2000.00

Enter the following bill amounts for Mary Davis last month:

Electric Bill: 34.89

Gas Bill: 120.45

Water Bill: 53.64

Bill Calculator Report for Mary Davis:

Total Bills for the month: $208.98

- Your bills total more than 10% of your income. Try to keep this amount under 10% in the future.

- Based on this total, you should set aside $52.25 per week to cover your expenses

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

5. Develop the succession planning review.

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago