aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2/hw2_directory
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ee1301/wk2/hw2_directory/strap012_2A.cpp7
-rw-r--r--ee1301/wk2/hw2_directory/strap012_2B.cpp2
2 files changed, 6 insertions, 3 deletions
diff --git a/ee1301/wk2/hw2_directory/strap012_2A.cpp b/ee1301/wk2/hw2_directory/strap012_2A.cpp
index 9b9171f..35e9fed 100644
--- a/ee1301/wk2/hw2_directory/strap012_2A.cpp
+++ b/ee1301/wk2/hw2_directory/strap012_2A.cpp
@@ -14,10 +14,12 @@ int main () {
int countOG=0, i=0, j=0;
do {
+
do {
- cout << "Enter an integer from -50 to 50: ";
- cin >> countOG;
+ cout << "Enter an integer from -50 to 50: ";
+ cin >> countOG;
} while (countOG > 50 || countOG < -50);
+
int count=countOG; //Store original integer for comparison to break loop
if (countOG < 0){
@@ -41,6 +43,7 @@ do {
cout << endl;
}
}
+
} while (countOG != 0);
cout << "Goodbye." << endl;
return 0;
diff --git a/ee1301/wk2/hw2_directory/strap012_2B.cpp b/ee1301/wk2/hw2_directory/strap012_2B.cpp
index 02b5f7b..f300a04 100644
--- a/ee1301/wk2/hw2_directory/strap012_2B.cpp
+++ b/ee1301/wk2/hw2_directory/strap012_2B.cpp
@@ -5,7 +5,7 @@ Student ID number: 5449340
Course number: EE1301
Term: Spring 2019
Lab/assignment number: Homework 2B
-Short Program Description: Pay Stub Calculator
+Short Program Description: Time Calculator
*/
#include <iostream>