-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain
More file actions
54 lines (40 loc) · 1.03 KB
/
main
File metadata and controls
54 lines (40 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <stdio.h>
#include<c.math>
using namespace std;
int main()
{
float a,i=0,e=0;
//Accept the incomes
cout<<"\nEnter salary: \t";
cin>>a;
i+=a;
cout<<"\nEnter rent: \t";
cin>>a;
i+=a;
cout<<"\nEnter bonus: \t";
cin>>a;
i+=a;
//Display total income
cout<<"\nTotal income = "<<i<<"\n";
//Accept the expenses
cout<<"\nEnter household spending: \t";
cin>>a;
e+=a;
cout<<"\nEnter loans: \t";
cin>>a;
e+=a;
cout<<"\nEnter entertainment: \t";
cin>>a;
e+=a;
//Display total expense
cout<<"\nTotal expense = "<<e<<"\n";
//Display appropriate message
if(i>e)
cout<<"\nCongratulation, you have remaining of "<<i-e<<" this month. You can save "<<i-e<<" according to the x% you set.\n";
else if(i<e)
cout<<"\nyou have overspent for this month and no saving could be made";
else
cout<<"\nincome = expense, no savings!";
return 0;
}