i have written the program but my month function is making problem plz chk it and correct it
#include <iostream>
#include <stdlib.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
using namespace std;
class expense
{
private:
int income;
int gbill;
int ebill;
int wbill;
int oexpense;
string month[20];
public:
expense()
{ income=0;
ebill=0;
wbill=0;
gbill=0;
}
expense(int,int, int, int);
void display();
void saving();
void setTotalIncome();
void setOexpenses();
void setEBill();
void setWBill();
void setGBill();
void setmonth();
void setoexpense();
void Add_expense();
int getOexpenses();
int getEBill();
int getWBill();
int getGBill();
string getMonth();
~expense()
{
}
};
void expense::saving() // Saving----------------------
{
int save;
save=income-(ebill+wbill+gbill);
if(save<=0)
cout<<"\nNo saving";
else
cout<<"Saving: "<<save;
}
void expense::display() //display-------------------------
{ cout<<"\n---- Display Expenses------ \n";
cout<<"\n\nTotal Income: "<<income;
cout<<"\n\nElectric Bill: "<<getEBill();
cout<<"\n\nGas Bill: "<<getGBill();
cout<<"\n\nWater Bill: "<<getWBill();
cout<<"\n\nOther Expenses: "<<getOexpenses();
cout<<"\n\nMonth in alphabets: "<<month;
}
void expense::Add_expense() // add Expenses------------------
{
setTotalIncome();
setEBill();
setGBill();
setWBill();
setOexpenses();
setmonth();
}
void expense::setmonth()
{
cout<<"\n Enter the Month: ";
getMonth();
}
void expense::setTotalIncome()
{ cout<<"\nEnter the Total Income: ";
cin>>income;
}
void expense::setEBill()
{ cout<<"\nEnter the Electric Bill: ";
cin>>ebill;
}
void expense::setGBill()
{
cout<<"\nEnter the GasBill: ";
cin>>gbill;
}
void expense::setWBill()
{
cout<<"\nEnter Water Bill: ";
cin>>wbill;
}
void expense::setOexpenses()
{ cout<<"\nEnter Other Expenses amount: ";
cin>>oexpense;
}
/////////////////////////////////////////////////////
int expense::getEBill()
{
return ebill;
}
int expense::getGBill()
{
return gbill;
}
int expense::getWBill()
{
return wbill;
}
int expense::getOexpenses()
{ return oexpense;
}
int main()
{
expense m1;
int choice;
char ch='n';
do{
cout<<"\n\t Menu\n\n";
cout<<"\n\t 1. Add Expenses ";
cout<<"\n\t 2. Display Expenses";
cout<<"\n\t 3. Display Saving";
cout<<"\n\nEnter the Choice............. ";
cin>>choice;
switch(choice)
{ case 1:
m1.Add_expense();
break;
case 2:
m1.display();
break;
case 3:
m1.saving();
break;
}
cout<<"\n\n\tWant to continue[enter y]..............";
cin>>ch;
}
while(ch=='y');
getch();
}