-
Notifications
You must be signed in to change notification settings - Fork 0
/
userInput.cpp
79 lines (60 loc) · 1.49 KB
/
userInput.cpp
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
74
75
76
77
78
79
#include "userInput_.h"
#include <iostream>
/*
* Class for obtaining necessary values and displaying text for other objects/classes
*/
UserInput::UserInput() {};
/*
* Method for creating a User object
*/
void UserInput::ioCreateUser(string& name, string& surname, int &balance) {
cout << "Type in name: ";
cin >> name;
cout << endl << "Type in surname: ";
cin >> surname;
cout << endl << endl;
}
/*
* Method used for a login class
*/
void UserInput::ioCreateLogin(string& name, int& id) {
cout << endl <<"Type in your name: ";
cin >> name;
cout << endl <<"Type in your id: ";
cin >> id;
}
/*
* Method for displaying transaction options
*/
void UserInput::ioTransactionsOptions() {
cout << endl << "What you want to do?" << endl;
cout << endl << "1. Deposit";
cout << endl << "2. Withdraw";
cout << endl << "3. Transfer";
cout << endl << "4. Show balance";
cout << endl << "5. Exit" << endl;
}
/*
* Method for getting the recipient's ID for a transfer
*/
int UserInput::ioTransferGetID() {
int id;
cout << endl << "Enter recipients ID: ";
cin >> id;
return id;
}
/*
* Methods for handling money transfers and operations
*/
void UserInput::ioHowMuchToDeposit(double& amount) {
cout << endl << "How much you want to deposit ";
cin >> amount;
}
void UserInput::ioHowMuchToWithdrawal(double& amount) {
cout << endl << "How much you want to withdraw: ";
cin >> amount;
}
void UserInput::ioHowMuchToTransfer(double& amount) {
cout << endl << "How much you want to transfer: ";
cin >> amount;
}