-
Notifications
You must be signed in to change notification settings - Fork 0
/
Expenses.cpp
53 lines (37 loc) · 929 Bytes
/
Expenses.cpp
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
#include <iostream>
using namespace std;
// Sharif Ullah Danish
int main()
{
const int PER=3;
const int MONTH=6;
int data[PER][MONTH];
for(int i=0; i<PER; i++)
{
int total=0, max=0, min=99999;
cout<<"\n User "<<i+1<<" Data: "<<endl;
for(int j=0; j<MONTH; j++)
{
cout<<"Enter expenses for month "<<j+1<<": ";
cin>>data[i][j];
total+=data[i][j];
if(data[i][j]>max) max = data[i][j];
if(data[i][j]<min) min = data[i][j];
}
// we use loop for just stars
for(int a=0; a<40; a++)
cout<<"-";
cout<<"\n User "<<i+1<<" \t 6 month expenses \n";
for(int a=0; a<40; a++)
cout<<"-";
cout<<"\n Total is: "<<total;
cout<<"\n Highest is: "<<max;
cout<<"\n Lowest is: "<<min<<endl;
// we use loop for just stars
for(int a=0; a<40; a++)
{
cout<<"*";
}
}
return 0;
}