-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstraction.cpp
More file actions
78 lines (67 loc) · 1.03 KB
/
Copy pathAbstraction.cpp
File metadata and controls
78 lines (67 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
#include <iostream>
using namespace std;
class Vehicle
{
private:
void piston()
{
cout << "4 piston\n";
}
void manWhoMade()
{
cout << "Markus Librette\n";
}
public:
void company()
{
cout << "GFG\n";
}
void model()
{
cout << "SIMPLE\n";
}
void color()
{
cout << "Red/GREEN/Silver\n";
}
void cost()
{
cout << "Rs. 60000 to 900000\n";
}
void oil()
{
cout << "PETROL\n";
}
};
int main()
{
Vehicle obj;
obj.company();
obj.model();
obj.color();
obj.cost();
obj.oil();
}
*/
#include<iostream>
using namespace std;
class Base{
private :
int a, b;
public:
void setData(int x, int y){
a = x;
b = y;
}
void display(){
cout << "The value of a is: " << a << endl;
cout << "The value of b is: " << b << endl;
}
};
int main(){
Base ob;
ob.setData(7, 5);
ob.display();
return 0;
}