-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclocktest.cpp
More file actions
73 lines (64 loc) · 2.16 KB
/
clocktest.cpp
File metadata and controls
73 lines (64 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>
#include<iomanip>
#include<string>
#include<cstdio>
using namespace std;
int main() {
int hrs;
int mins;
int clock_12;
int clock_24;
char input;
hrs = clock_24 / 100;
mins = clock_24 % 100;
bool Button_pressed;
cout << "clear screen" << endl;
while (Button_pressed == true)
{
cin >> Button_pressed;
if (Button_pressed == 'N') {
hrs = hrs + 1;
cout << "Clear screen" << endl;
}
else if (Button_pressed == 'Y') {
std::cout << "Menu:" << std::endl;
std::cout << "User input:" << std::endl;
cin >> input;
if (input = 'Y') {
break;
}
else if (input = 'N') {
std::cout << "Do you want to add an hour?" << std::endl;
cin >> input;
if (input == 'Y') {
mins = mins + 1;
break;
}
else if (input == 'N') {
std::cout << "Do you want to add a minute?" << std::endl;
std::cin >> input;
if (input == 'Y') {
break;
}
else if (input == 'N') {
std::cout << "Do you want to add a second?" << std::endl;
std::cin >> input;
if (input == 'Y') {
break;
}
else
{
break;
}
}
}
}
}
}
std::cout << std::string(23, '*') << " " << std::string(23, '*') << std::endl;
std::cout << "* 12-hour Clock *" << " " << "* 24-hour Clock *" << std::endl;
std::cout << "* " << clock_12 << " *" << " " << "* " << clock_24 << " *" << std::endl;
std::cout << std::string(23, '*') << " " << std::string(23, '*') << std::endl;
system("pause");
return 0;
}