-
Notifications
You must be signed in to change notification settings - Fork 0
/
FF1.cpp
40 lines (39 loc) · 885 Bytes
/
FF1.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
#include<iostream>
using namespace std;
class home
{
private:
int chocolate,pastery,jelly;
public :
home()
{
chocolate=0;
pastery=0;
jelly=0;
}
void setvalue(int a,int b ,int c)
{
chocolate=a;
pastery=b;
jelly=c;
cout<<"Updated Fridge Quantities right now "<<endl<<"Chocolate= "<<chocolate<<endl<<"Pastery= "<<pastery<<endl<<"Jelly= "<<jelly<<endl;
}
void show()
{
cout<<"Fridge Quantities right now "<<endl<<"Chocolate= "<<chocolate<<endl<<"Pastery= "<<pastery<<endl<<"Jelly= "<<jelly<<endl;
}
friend void eat(home o)
{
cout<<"ammount of chocolates eaten ="<<o.chocolate<<endl;
cout<<"ammount of pasteries eaten ="<<o.pastery<<endl;
cout<<"ammount of jellies eaten ="<<o.jelly<<endl;
}
};
int main()
{
home a;
a.show();
a.setvalue(10,12,13);
eat(a);
return 0;
}