-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhoneCall_Real.cpp
More file actions
67 lines (44 loc) · 1.07 KB
/
PhoneCall_Real.cpp
File metadata and controls
67 lines (44 loc) · 1.07 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
// PhoneCall_Real.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char day1;
char day2;
int dayNum;
int time1;
char colon;
int time2;
int callDuration;
// find out the day of the week
cout << "What day of the week is it: ";
cin >> day1;
cin >> day2;
// convert the day of the week input to uppercase
day1 = toupper(day1);
day2 = toupper(day2);
// convert the first day of the week letter to a number for use in the program
dayNum = static_cast<int>(day1);
// find out the hour
cout << "What time is it: ";
cin >> time1;
cin >> colon;
cin >> time2;
// find out how long the call was
cout << "How long was the call in minutes: ";
cin >> callDuration;
// calculate the cost
if ((dayNum == 77) || (dayNum == 84) ||(dayNum == 87) ||(dayNum == 70))
{
}
//test
cout << dayNum << endl;
cout << day1 << day2 << endl;
cout << time1 << time2 << endl;
cout << callDuration << endl;
system("pause");
return 0;
}