Question

In: Computer Science

C++ 11.11: Customer Accounts A student has established the following monthly budget: 500.00 Housing 150.00 Utilities...

C++

11.11: Customer Accounts A student has established the following monthly budget: 500.00 Housing 150.00 Utilities 65.00 Household 50.00 Expenses 50.00 Transportation 250.00 Food 30.00 Medical 100.00 Insurance 150.00 Entertainment 75.00 Clothing 50.00 Miscellaneous Write a program that has a MonthlyBudget structure designed to hold each of these expense categories. The program should pass the structure to a function that asks the user to enter the amounts spent in each budget category during a month. The program should then pass the structure to a function that displays a report indicating the amount over or under in each category, as well as the amount over or under for the entire monthly budget. NOTES: For each of the categories listed above, and in that order, the program prompts the user for the the amount spent on X: where X is a category from the above list (e.g. "Insurance"). Using the values read into the structure, the program generates a table with a heading and in each row there are four items: the category (e.g. "Housing"), followed by the value budgeted for the category (500.00 in the case of Housing), followed by the value that had been read in for that category, followed by the amount that the actual spent was over or under the category budget. Finally, after the table, is an indication of whether the student is over or under budget.

make sure it works with codelab

Solutions

Expert Solution

#include <iostream>

#include <cstring>

#include <string>

#include<bits/stdc++.h>

using namespace std;

//function prototypes

void input( struct MonthlyBudget rec[]);

void printRecord( struct MonthlyBudget r[]);

//structure named player

struct MonthlyBudget

{

float amount;

} ;

int main()

{

//structure array with 12 size

struct MonthlyBudget sarr[10];  

//function call to gather information from user

input(sarr);

system("pause"); //console visible purpose

return 0;

}

//function implementation-gathering information from user

void input(struct MonthlyBudget record[])

{

char category[10][20] = {"Housing", "Utilities", "Household", "Expenses","Transportation","Food",

"Medical","Insurance","Entertainment","Clothing"};

int i=0;

//loop to read inputs

for(i=0;i<10;i++)

{

cout<<"\nThe amount spent on "<<category[i]<<":";

cin>>record[i].amount;

//to ignore space in the name

cin.ignore(256, '\n');

//fflush(stdin);

}

//calling the function to print the student records

printRecord(record);

}

//implementing the function to dispplay the player information

void printRecord( struct MonthlyBudget record[])

{

char category[10][20] = {"Housing", "Utilities", "Household", "Expenses","Transportation","Food",

"Medical","Insurance","Entertainment","Clothing"};

float budget[10]={500,150,65,50,50,250,30,100,150,75};

int i;

cout<<"-----------------------------------------------------------------";

//For calculation purpose

int total=0;

string name;

cout<<"\n";

//loop to display the records present in structure

for(i=0;i<10;i++)

{

cout<<category[i]<<"\t";

cout<<record[i].amount<<"\t";

cout<<budget[i]<<"\t";

cout<<budget[i]-record[i].amount<<"\n";

}

//displyaing ouput

cout<<"\n";

}

OUTPUT:

THUMBS UP IF YOU LIKE IT !


Related Solutions

b) A high-school student has a monthly budget of $80 to spend on music and burritos....
b) A high-school student has a monthly budget of $80 to spend on music and burritos. Burritos cost $8 each, while songs are free after paying the Spotify monthly fee of $9.99. 1. In a diagram, measuring songs along the horizontal axis, draw the high-school student’s budget constraint. c) A family has an yearly income of $50,000 to spend on the kids’ education or on all other goods. 1. In a diagram measuring dollars spent on education along the horizontal...
Obligation Debt Amount Min Monthly Amount Annual Interest Rate Student loans $40,000.00 $500.00 6.00% Car loan...
Obligation Debt Amount Min Monthly Amount Annual Interest Rate Student loans $40,000.00 $500.00 6.00% Car loan $11,500.00 $375.00 9.50% Chase credit card $2,100.00 $84.00 18.00% Amazon credit card $1,050.00 $42.00 15.00% TJ Maxx credit card $380.00 $15.00 24.00% You recently graduated with a reasonably well paying job and after reviewing your budget you have an extra $200 a month to put towards paying off your debts as you have built up an appropriate savings. In exactly 12 months, you have...
Housing policy: Housing subsidies vs. Cash offer A low income household has a monthly income of...
Housing policy: Housing subsidies vs. Cash offer A low income household has a monthly income of 900, and is qualified to receive certain welfare from government in housing. This household has the following utility function and faces the following market information: U = X.Y where X is the housing consumption (sq.) while Y represents all other goods; Price of X (housing per square foot) is $0.5, and price of Y (all other goods) is normalized to be $1. Hint: MRS...
C++ 11.7: Customer Accounts Write a program that uses a structure to store the following data...
C++ 11.7: Customer Accounts Write a program that uses a structure to store the following data about a customer account: Customer name Customer address City State ZIP code Telephone Account balance Date of last payment The program should use an array of at least 20 structures. It should let the user enter data into the array, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Prompts...
Jim and Wendy had the following interest expenses in 2019: Personal Loan………………… $500.00 Student Loan Interest…………....
Jim and Wendy had the following interest expenses in 2019: Personal Loan………………… $500.00 Student Loan Interest…………. $3,000.00 Mortgage interest……………… $5,000.00 Investment interest…………….$7,500.00                       Net investment income for 2019 is $6,000.00.            What is their interest deduction for 2019?
Variance Analysis Question The Glass Vessel Company has established the following budget for producing one of...
Variance Analysis Question The Glass Vessel Company has established the following budget for producing one of its handblown vases: Materials (silica) 2 pounds @ 1.25 per pound Labor 1.5 hours @ $15.00 per hour In March of the most recent year, Glass Vessel produced 300 vases using 650 pounds of materials. Glass Vessel purchased the 650 pounds of materials for $845. Actual total labor costs for March were $7,200, which entailed 480 hours of labor. Please answer both of the...
2 . Atlantic Company has the following monthly flexible budget information based on an expectation of...
2 . Atlantic Company has the following monthly flexible budget information based on an expectation of operating at 80% of the factory’s capacity or 10,000 units produced: Operating Levels 70% 80% 90% Budgeted output in units 8,000 10,000 12,000 Budgeted labor (standard hours) 16,000 20,000 24,000 Budgeted overhead Variable overhead $ 48,000 $60,000 $ 72,000 Fixed overhead 40,000 40,000 40,000 Total overhead $ 88,000 $100,000 $112,000 During the current month, the company operated at 70% of capacity and employees worked...
The following data represent the monthly phone​ use, in​ minutes, of a customer enrolled in a...
The following data represent the monthly phone​ use, in​ minutes, of a customer enrolled in a fraud prevention program for the past 20 months. The phone company decides to use the upper fence as the cutoff point for the number of minutes at which the customer should be contacted. 446, 363, 488, 329, 468, 304, 444, 459, 336, 415, 403, 542, 473, 448, 531, 355, 451, 547, 465, 334 What is the cutoff​ point?
The following data represent the monthly phone​ use, in​ minutes, of a customer enrolled in a...
The following data represent the monthly phone​ use, in​ minutes, of a customer enrolled in a fraud prevention program for the past 20 months. The phone company decides to use the upper fence as the cutoff point for the number of minutes at which the customer should be contacted. What is the cutoff​ point? 397 391 401 438 342 518 516 335 301 347 500 388 325 422 510 434 541 303 321 345 The cutoff point is minutes.
Would a forecast budget work good for an established organization that has volatile changes throughout the...
Would a forecast budget work good for an established organization that has volatile changes throughout the year? My bigger question here is are there other factors besides how established the organization is that may determine which type of budget they need to use?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT