aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab4/CST116F2021-Lab4.cpp
diff options
context:
space:
mode:
authorWiserJ <[email protected]>2021-10-20 16:51:18 -0700
committerWiserJ <[email protected]>2021-10-20 16:51:18 -0700
commit0b04a03e1b637a2c1f7d2809a3a6d58470798474 (patch)
tree622bdb852c415f2f52021484c6a73c41350035e9 /CST116F2021-Lab4/CST116F2021-Lab4.cpp
parenttime program start (diff)
downloadcst116-lab4-jeffwoit-0b04a03e1b637a2c1f7d2809a3a6d58470798474.tar.xz
cst116-lab4-jeffwoit-0b04a03e1b637a2c1f7d2809a3a6d58470798474.zip
inputs
Diffstat (limited to 'CST116F2021-Lab4/CST116F2021-Lab4.cpp')
-rw-r--r--CST116F2021-Lab4/CST116F2021-Lab4.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/CST116F2021-Lab4/CST116F2021-Lab4.cpp b/CST116F2021-Lab4/CST116F2021-Lab4.cpp
index 2859c0d..1006a43 100644
--- a/CST116F2021-Lab4/CST116F2021-Lab4.cpp
+++ b/CST116F2021-Lab4/CST116F2021-Lab4.cpp
@@ -16,9 +16,23 @@ int main()
void GetInput(int hours_input, int minutes_input, int seconds_input)
{
- cout << "Please enter the current hour of day: ";
- cin >> hours_input;
+ do
+ {
+ cout << "Please enter the current hour out of 24 per day: ";
+ cin >> hours_input;
+ } while (hours_input <= 0 || hours_input > 24);
+ do
+ {
+ cout << "Please enter the current minutes out of 60 per hour: ";
+ cin >> minutes_input;
+ } while (minutes_input <= 0 || minutes_input > 60);
+
+ do
+ {
+ cout << "Please enter the current seconds out of 60 per minute: ";
+ cin >> seconds_input;
+ } while (seconds_input <= 0 || seconds_input > 60);
}
void DisplayTime(float standard_display, float military_display, float hours_display)