Problem Statement: Expense class You are required to write a class name “Expense
ID: 3616119 • Letter: P
Question
Problem Statement: Expense class
You are required to write a class name “Expenses “.Expenses class has
· Constructors
· Destructor
· Write a function to add expenses for a month
· Write function which displays these expenses.
· Write a function which calculates savings for amonth.
· Expense class has following data members
o Total Income // total income ofperson/family
o Gbill //Gasbill
oEbill //Electricitybill
o Wbill // waterBill
o OExpenses // any other expenses
o Month //Month for whichyou are calculating these expenses
You have to populate all these record on monthly basis; topopulate records; you have to use getter and setters for all datamembers.
Problem Statement: Expense class
You are required to write a class name “Expenses “.Expenses class has
· Constructors
· Destructor
· Write a function to add expenses for a month
· Write function which displays these expenses.
· Write a function which calculates savings for amonth.
· Expense class has following data members
o Total Income // total income ofperson/family
o Gbill //Gasbill
oEbill //Electricitybill
o Wbill // waterBill
o OExpenses // any other expenses
o Month //Month for whichyou are calculating these expenses
You have to populate all these record on monthly basis; topopulate records; you have to use getter and setters for all datamembers.
Explanation / Answer
please rate - thanks #include #include using namespace std; class Expenses { public: Expenses(); double addExpenses(); void printExpenses(); double savings(); double getInclome(); void setIncome(double money); double getGbill(); void setGbill(double bill); double getWbill(); void setWbill(double bill); double Oexpense(); void setOexpense(double bill); string getMonth(); void setMonth(string month); private: double totalIncome; double Gbill; double Wbill; double Oexpenses; string Month; }; Expenses::Expenses(){ totalIncome = 0.0; Gbill = 0.0; Wbill = 0.0; Oexpenses = 0.0; Month = " "; } //******************************** double Expenses::addExpenses(){ return Gbill + Wbill + Oexpenses; } //******************************* void Expenses::printExpenses(){ coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.