summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lawrance <[email protected]>2021-10-17 13:42:31 -0700
committerJames Lawrance <[email protected]>2021-10-17 13:42:31 -0700
commit5a6cd0eea62bc4ad0de24af345341f5d0af2da65 (patch)
tree0ec6f7c5f1a132b767846518e2a6b7ba95fcf0d5
parentCommit 4 (diff)
downloadcst116-proj1-jemersonlawrance-5a6cd0eea62bc4ad0de24af345341f5d0af2da65.tar.xz
cst116-proj1-jemersonlawrance-5a6cd0eea62bc4ad0de24af345341f5d0af2da65.zip
Completed Project 1
10/17/21
-rw-r--r--CST116F2021-Proj1/CST116F2021-Proj1.cpp74
1 files changed, 70 insertions, 4 deletions
diff --git a/CST116F2021-Proj1/CST116F2021-Proj1.cpp b/CST116F2021-Proj1/CST116F2021-Proj1.cpp
index acd7dc5..4b04deb 100644
--- a/CST116F2021-Proj1/CST116F2021-Proj1.cpp
+++ b/CST116F2021-Proj1/CST116F2021-Proj1.cpp
@@ -1,7 +1,73 @@
#include <iostream>
using namespace std;
-int main()
-{
- cout << "Project 1 Working";
-} \ No newline at end of file
+
+//MY functioning code
+//int main()
+//{
+// float radius;
+// float height;
+
+// cout << "Enter cylinder radius " << endl;
+// cin >> radius;
+// cout << "Enter cylinder height " << endl;
+// cin >> height;
+
+// float volume = (3.14) * (radius * radius) * (height);
+
+// cout << "Your cylinder's volume is " << volume;
+
+// return 0;
+//}
+
+//MY code with 1 syntax error and 1 logic error
+//int main()
+//{
+// float radius;
+// float height;
+
+// cout << "Enter cylinder radius" << endl;
+// cin >> radius;
+// cout << "Enter cylinder height"; << endl;
+// cin >> height;
+
+// bool volume = (3.14) * (radius * radius) * (height);
+
+// cout << "Your cylinder's volume is " << volume;
+
+// return 0;
+//}
+
+//Partner's code with 1 syntax error and 1 logic error
+//int main() {
+//
+// do
+// {
+// float cylinderR = 0;
+// float cylinderH = 0;
+// float pi = 3.1415;
+// std::cout << "What is the height of your cylinder?\n";
+// std::cin >> cylinderH;
+// std::cout << "What is the Radius of your cylinder?\n";
+// std::cin >> cylinderR;
+// float cylinderTotal = pi * cylinderH * cylinderR + cylinderR;
+// std::cout << "The volume of your cylinder is " << cylinderTotal << ".\n"
+// } while (true);
+//}
+
+//Partner's corrected code
+//int main() {
+
+// do
+// {
+// float cylinderR = 0;
+// float cylinderH = 0;
+// float pi = 3.1415;
+// std::cout << "What is the height of your cylinder?\n";
+// std::cin >> cylinderH;
+// std::cout << "What is the Radius of your cylinder?\n";
+// std::cin >> cylinderR;
+// float cylinderTotal = pi * cylinderH * (cylinderR * cylinderR);
+// std::cout << "The volume of your cylinder is " << cylinderTotal << ".\n";
+// } while (true);
+//} \ No newline at end of file