-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA7Q1.cpp
More file actions
94 lines (77 loc) · 1.86 KB
/
A7Q1.cpp
File metadata and controls
94 lines (77 loc) · 1.86 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include <iostream>
#include <iomanip>
using namespace std;
float Tarea, TPerimeter, Rarea, RPerimeter;
float a = 4.3f, b = 6.1f, c = 9.5f, h = 10.7f;
float l = 15.1f, w = 10.6f;
float half = .5f, timesTwo = 2.0f;
void printShapes()
{
cout << " /| \\ " << endl;
cout << " / | \\ " << endl;
cout << "a / | \\ b" << endl;
cout << " / h| \\ " << endl;
cout << "/ | \\ " << endl;
cout << "____________ " << endl;
cout << " c " << endl;
cout << " -------------------------- " << endl;
cout << " | |" << endl;
cout << " | | width" << endl;
cout << " | |" << endl;
cout << " | |" << endl;
cout << " --------------------------" << endl;
cout << " length " << endl;
cout << "What is the vaule of a?" << endl;
cin >> a;
cout << "What is the vaule of b?" << endl;
cin >> b;
cout << "What is the vaule of c?" << endl;
cin >> c;
cout << "What is the vaule of h?" << endl;
cin >> h;
cout << "What is the vaule of length?" << endl;
cin >> l;
cout << "What is the vaule of width?" << endl;
cin >> w;
}
void printVaules()
{
cout << fixed << setprecision(2);
cout << "Triangle" << endl;
cout << "Area................" << Tarea << endl;
cout << "Permeter............" << TPerimeter << endl;
cout << "Rectangle" << endl;
cout << "Area................" << Rarea << endl;
cout << "Permeter............" << RPerimeter << endl;
}
int main()
{
_asm
{
call printShapes
fld a;
fld b;
fld c;
fadd;
fadd;
fstp TPerimeter;
fld half;
fld c;
fld h;
fmul;
fmul;
fstp Tarea;
fld w
fld l
fmul;
fstp Rarea;
fld timesTwo;
fld l;
fld w;
fadd;
fmul;
fstp RPerimeter;
call printVaules
}
return 0;
}