aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk5/lab4/partner3.cpp
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2020-01-30 16:55:04 -0600
committerRossTheRoss <mstrapp@protonmail.com>2020-01-30 16:55:04 -0600
commit175721a63b426355274fa9e8063f762020ab8362 (patch)
treecf2c1b33233d660c9f50de5e659b9343bb264984 /ee1301/wk5/lab4/partner3.cpp
parentMake Python thing in Python (diff)
downloadhomework-175721a63b426355274fa9e8063f762020ab8362.tar
homework-175721a63b426355274fa9e8063f762020ab8362.tar.gz
homework-175721a63b426355274fa9e8063f762020ab8362.tar.bz2
homework-175721a63b426355274fa9e8063f762020ab8362.tar.lz
homework-175721a63b426355274fa9e8063f762020ab8362.tar.xz
homework-175721a63b426355274fa9e8063f762020ab8362.tar.zst
homework-175721a63b426355274fa9e8063f762020ab8362.zip
R E A R R A N G E
Diffstat (limited to 'ee1301/wk5/lab4/partner3.cpp')
-rw-r--r--ee1301/wk5/lab4/partner3.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/ee1301/wk5/lab4/partner3.cpp b/ee1301/wk5/lab4/partner3.cpp
deleted file mode 100644
index 75d6d7b..0000000
--- a/ee1301/wk5/lab4/partner3.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <iostream>
-
-using namespace std;
-
-string requestName();
-double requestHeight(string fullName);
-int requestNumberOfPartners();
-void NotinMain(string array1[], double array2[], int numberOfPartners);
-
-int main()
-{
- int numberOfPartners = requestNumberOfPartners();
- string fullName[100]; //fullName1, fullName2;
- double height[100]; //height1, height2;
-
- // fullName[0] = requestName();
- // height[0] = requestHeight(fullName[0]);
- for (int i=0; i<numberOfPartners; i++) {
- fullName[i] = requestName();
- height[i] = requestHeight(fullName[i]);
- }
- NotinMain(fullName, height, numberOfPartners);
-}
-
-string requestName()
-{
- string name;
- cout << "Please enter full name: ";
- getline(cin, name);
- return name;
-}
-
-double requestHeight(string fullName)
-{
- double height;
- cout << "Please enter " << fullName << "'s height: ";
- cin >> height;
- cin.ignore(2, '\n'); // gets rid of \n in the buffer
-
- return height;
-}
-
-int requestNumberOfPartners()
-{
- int numberOfPartners;
- cout << "How many partners are there? ";
- cin >> numberOfPartners;
- cin.ignore(2, '\n');
-
- return numberOfPartners;
-}
-
-void NotinMain(string array1[100], double array2[100], int numberOfPartners) {
- double heightTotal=0;
- cout << "If " << array1[0];
- for (int i=1; i<numberOfPartners-1; i++) {
- cout << ", " << array1[i];
- heightTotal += array2[i];
- }
- cout << " and " << array1[numberOfPartners-1]
- << " form a human tower, their combined height will be "
- << (array2[0] + heightTotal + array2[numberOfPartners-1]) << endl;
- }