-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorldCPP.cpp
More file actions
71 lines (45 loc) · 1.35 KB
/
Copy pathHelloWorldCPP.cpp
File metadata and controls
71 lines (45 loc) · 1.35 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
#include <iostream>
#include <cmath>
#include <thread>
#include <chrono>
#include <algorithm>
#include <libc.h>
using namespace std;
int main()
{
double dollar_exch = 85.6;
double pound_st_exch = 107.3;
double can_dollar_exch = 57.8;
double index = 0;
char unit = ' ';
cout << "Please iner sum and the unit (d or c or p)\n";
cin >> index >> unit;
if (unit == 'd')
cout << index << " Dollar == " << dollar_exch*index << " rub\n";
else if (unit == 'c')
cout << index << " Can.Dollar == " << can_dollar_exch*index << " rub\n";
else if (unit == 'p')
cout << index << " Pound Sterling == " << pound_st_exch*index << " rub\n";
else
cout << "Eror : '" << unit << "'\n";
cout << '\n';
cout << "Please enter sum rub exchange and index Dollar(r), Can.Dollar(g), Pound Sterling(h): \n";
cin >> index >> unit;
switch (unit)
{
case 'r':
cout << index << " rub == " << index/dollar_exch << " dollar\n";
break;
case 'g':
cout << index << " rub == " << index/can_dollar_exch << " Can.dollar\n";
break;
case 'h':
cout << index << " rub == " << index/pound_st_exch << " pound.st\n";
break;
default:
cout << "Error: '" << unit << "'\n";
break;
}
cout << '\n';
std::this_thread::sleep_for(std::chrono::seconds(3));
}