C++
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
70
1
2
3
using namespace std;
4
5
string password = "";
6
string client = "";
7
8
void DisplayInfo() {
9
cout << "What would you like to do?" << endl;
10
11
cout << "DISPLAY the client list (enter 1)" << endl;
12
cout << "CHANGE a clients choice (enter 2)" << endl;
13
cout << "Exit program.. (enter 3)" << endl;
14
15
}
16
17
void CheckUserPermissionAccess() {
18
cout << "Enter your username: " << endl;
19
cin >> client;
20
21
cout << "Enter password: " << endl;
22
cin >> password;
23
24
if(password == "22420"){
25
cout <<"You chose" << endl;
26
} else {
27
cout << "Invalid Password. Please try again" << endl;
28
}
29
}
30
31
void ChangeCustomerChoice() {
32
cout << "Clients Name Service Selected: "<< endl;
33
34
string i;
35
string one = "1 = Brokerage";
36
string two = "2 = Retirement";
37
38
cin >> i;
39
40
41
if (i == one) {
42
cout << one;
43
}
44
if (i == two) {
45
cout << two;
46
}
47
48
cout << "Selected Option" << endl;
49
50
cout << "Enter the number of the client that you wish to change" << endl;
51
cin >> client;
52
53
cout << "Please enter the client's new service choice (1 = Brokerage, 2 = Retirement)" << endl;
54
cin >> i;
55
}
56
57
58
int main() {
59
60
cout << "Created by: John Smith" << endl;
61
62
cout << "Hello! Welcome to our Investment Company" << endl;
63
64
CheckUserPermissionAccess();
65
66
DisplayInfo();
67
68
ChangeCustomerChoice();
69
70
}
$ g++ prog.cc -Wall -Wextra -std=gnu++2a
Start
Created by: John Smith Hello! Welcome to our Investment Company Enter your username: Enter password: Invalid Password. Please try again What would you like to do? DISPLAY the client list (enter 1) CHANGE a clients choice (enter 2) Exit program.. (enter 3) Clients Name Service Selected: Selected Option Enter the number of the client that you wish to change Please enter the client's new service choice (1 = Brokerage, 2 = Retirement)
0
Finish