Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi my name is diamoni and using C++ can you Create a program that gets a users utility bill amounts for a month, calculates the

hi my name is diamoni and using C++ can you

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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

Students also viewed these Databases questions