aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2/hw2_directory/strap012_2B.cpp
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-02-19 21:44:42 -0600
committerRossTheRoss <msattr@gmail.com>2019-02-19 21:44:42 -0600
commitd8d0c36dfa1530ce8efcba24d796dfcea32a81fb (patch)
treea06985e09d80ab72bef7b49f3e78eac6c96e6f46 /ee1301/wk2/hw2_directory/strap012_2B.cpp
parentAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH (diff)
downloadhomework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.tar
homework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.tar.gz
homework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.tar.bz2
homework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.tar.lz
homework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.tar.xz
homework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.tar.zst
homework-d8d0c36dfa1530ce8efcba24d796dfcea32a81fb.zip
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
Diffstat (limited to 'ee1301/wk2/hw2_directory/strap012_2B.cpp')
-rw-r--r--ee1301/wk2/hw2_directory/strap012_2B.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/ee1301/wk2/hw2_directory/strap012_2B.cpp b/ee1301/wk2/hw2_directory/strap012_2B.cpp
deleted file mode 100644
index fb07e18..0000000
--- a/ee1301/wk2/hw2_directory/strap012_2B.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-Date: 20 Feb 2019
-Name: Matthew Strapp
-Student ID number: 5449340
-Course number: EE1301
-Term: Spring 2019
-Lab/assignment number: Homework 2B
-Short Program Description: Time Travel Calculator
-*/
-
-//PROGRAMMER'S NOTE: This problem legitimately stumped me. I won't be suprised if this is where I lose most of my points for this assignment.
-
-#include <iostream>
-using namespace std;
-int main()
-{
-
- bool change12 = 0, foo = 0, bar = true; //Workaround to prevent unneeded if statements
- char Time, travel; //"time" is reserved by C++, "Time" is not
- int hourOG, hourChange, hourNew, intervalChange = 0, timeChange = 1;
- cout << "Enter current time (A for AM, P for PM): ";
- cin >> hourOG >> Time;
- cout << "How many hours forward or backward do you want to move the clock (F for forwards, B for backward): ";
- cin >> travel >> hourChange;
- for (int i = hourChange; i >= 0; i--)
- {
- if (i != 0)
- {
- intervalChange++;
- }
-
- if (travel == 'F')
- {
- if (hourOG + hourChange >= 12 && bar)
- {
- if (hourOG + hourChange == 12)
- {
- timeChange++;
- }
- else
- {
- hourNew = (hourOG + hourChange) - 12;
- bar = false;
- }
- }
- }
-
- if (travel == 'B')
- {
- }
- if (intervalChange >= 12)
- {
- intervalChange = 0;
- timeChange++;
- }
- }
-
- for (timeChange; timeChange > 1; timeChange--)
- {
- if (Time == 'A')
- {
- Time += 15;
- }
- else
- {
- if (Time == 'P')
- {
- Time -= 15;
- }
- }
- }
- if (travel == 'F')
- {
- hourNew = hourOG + intervalChange;
- }
- if (travel == 'B')
- {
- hourNew = hourOG + intervalChange;
- }
-
- cout << "The new time is: " << hourNew << " " << Time << "M" << endl;
- return 0;
-} \ No newline at end of file