Write a monthly budget program passing the structure to a function which design
ID: 3632622 • Letter: W
Question
Write a monthly budget program passing the structure to a function which design to hold each expense categories :housing,utilities,household expenses,transportation,food,medical,insurance,entertainment,clothing, miscellaneous
and when user enter amount spent ,display amount over and under,and input validation (do not accept negative).
Explanation / Answer
#include using namespace std; const int NUM_EXP = 10; const int EXP_AMT = 1420; struct MonthlyBudget { int house; int util; int he; int trans; int food; int med; int ins; int ent; int cloth; int misc; int gross; }; void getSpentBudget(MonthlyBudget *actual) { cout > actual->house; cout > actual->util; cout > actual->he; cout > actual->trans; cout > actual->food; cout > actual->med; cout > actual->ins; cout > actual->ent; cout > actual->cloth; cout > actual->misc; } void reportBudget(MonthlyBudget &actual) { //Calculate the student's expenditures for the month actual.gross = 0; actual.gross = actual.house + actual.util + actual.he + actual.trans + actual.food + actual.med + actual.ins + actual.ent + actual.cloth + actual.misc; if (actual.grossRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.