@BilalMuakkit/

RubberyBossyNanotechnology

C++

No description

fork
loading
Files
  • main.cpp
main.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
#include <iostream>

using namespace std;

class addingUp
{
private:
int data1;
float height;
float width;

public:
void showNumber(int d)
{
data1 = d;
cout << "Number: " << d;
}
double performCalc()
{
cout << "\nInsert Height: ";
cin >> height;
cout << "Insert Width: ";
cin >> width;
float area = height * width;
return area;
}
};
int main() 

{
addingUp o1, o2;
float pullfromClass;

o1.showNumber(64);
pullfromClass = o2.performCalc();
cout << "The area of your shape is " << pullfromClass << "." << endl;
return 0;
}