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 a month.
• Expense class has following data members
o Total Income // total income of person/family
o Gbill //Gas bill
o Ebill //Electricity bill
o Wbill // water Bill
o OExpenses // any other expenses
o Month //Month for which you are calculating these expenses
You have to populate all these record on monthly basis; to populate records; you have to use getter and setters for all data members
#include <iostream>
using namespace std;
class expense
{
private:
int income;
int gbill;
int ebill;
int wbill;
int saving;
public:
void display();
void getTotalIncome();
void getEBill();
void getWBill();
void getGBill();
}
void expense::display()
{
cout <<"expense"<<income<<","<<ebill<<","<<gbill<<","<<wbill;
void expense::getTotalIncome(int i)
{
income=i;
return income;
}
void expense::getEBill(int i)
{
ebill=i;
return ebill;
}
void expense::getGBill(int i)
{
gbill=i;
return gbill;
}
void expense::getWBill(int i)
{
wbill=i;
return wbill;
}
int main()
{
expense m1,m2,m3,m4,m5,m6;
m1.display();
m2.display();
m3.display();
m4.display();
m5.display();
m6.display();
}