blob: f896d065203bc04868874a6b30f2005403607fdf (
plain) (
blame)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
// Joseph Ten Eyck - Cylinder Volume Calculation Program
//
//
// PSEUDOCODE
//
// 1) DISPLAY program purpose and input constraints.
// 2) Declare float variables for radius, height, and volume.
// 3) Query user for radius value.
// 4) Query user for height value.
// 5) Calculate volume of cylinder.
// 6) DISPLAY volume of cylinder.
//
//
//========================================
// THE CODE BELOW IS THE WORKING PROGRAM
//========================================
//#include <iostream>
//
//using std::cout;
//using std::cin;
//
//int main()
//{
// float radius,
// height,
// volume;
//
// cout << "\n\t\tCalculate the volume of a cylinder!";
// cout << "\n\t(Please only use positive numbers for radius and height)";
//
// cout << "\n\n\nInput radius: ";
// cin >> radius;
//
// cout << "\nInput height: ";
// cin >> height;
//
// volume = 3.14159235 * radius * radius * height;
//
// cout << "\n=============================";
// cout << "\n\nVolume: " << volume;
// cout << "\n\n";
//
// return 0;
//
//}
//=============================================================
// THE CODE BELOW INCLUDES 1 SYNTAX ERROR AND 1 LOGICAL ERROR
//=============================================================
//#include <iostream>
//
//using std::cout;
//using std::cin;
//
//int main()
//{
// float radius,
// height,
// volume;
//
// cout << "\n\t\tCalculate the volume of a cylinder!";
// cout << "\n\t(Please only use positive numbers for radius and height);
//
// cout << "\n\n\nInput radius: ";
// cin >> radius;
//
// cout << "\nInput height: ";
// cin >> height;
//
// volume = 3.14159235 * radius * radius + height;
//
// cout << "\n=============================";
// cout << "\n\nVolume: " << volume;
// cout << "\n\n";
//
// return 0;
//
//}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//===============================================
// THE CODE BELOW IS WRITTEN BY JUSITN VALDIVIA
//===============================================
// Working code
//#include <iostream>
//
//using std::cout;
//using std::cin;
//
//int main()
//{
// float height, radius, volume;
//
// cout << "Please enter the height of your cylinder:";
// cin >> height;
//
// cout << "Please enter the radius of your cylinder";
// cin >> radius;
//
// volume = 3.1415 * height * radius * radius;
// cout << "The volume of your cylinder is:" << volume;
//
// return 0;
//}
// Code with errors
//#include <iostream>
//
//using std::cout;
//using std::cin;
//
//float height, radiusvolume;
//
//cout << "Please enter the height of your cylinder:";
//cin >> height;
//
//cout << "Please enter the radius of your cylinder";
//cin >> radius;
//
//volume = 3.1415 * height * height * radius;
//cout << "The volume of your cylinder is:" << volume;
//
//return 0;
|