2025-05-26 09:40:01 +00:00
|
|
|
#include <iostream>
|
2025-05-28 08:54:22 +00:00
|
|
|
#include <cctype>
|
|
|
|
|
|
|
|
#include "AtmAdmin.h"
|
|
|
|
|
|
|
|
bool handleUserInformation(char choice, std::string& information) {
|
|
|
|
switch (choice) {
|
|
|
|
case '1':
|
|
|
|
std::cout << "Enter new pin: ";
|
|
|
|
std::cin >> information;
|
|
|
|
break;
|
|
|
|
case '2':
|
|
|
|
std::cout << "Enter the amount you wish to have: ";
|
|
|
|
std::cin >> information;
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
std::cout << "Enter your new username: ";
|
|
|
|
std::cin >> information;
|
|
|
|
break;
|
|
|
|
case 'q':
|
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
std::cout << "Invalid choice.\n";
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2025-05-26 09:40:01 +00:00
|
|
|
|
|
|
|
int main() {
|
2025-05-28 08:54:22 +00:00
|
|
|
bool continueLoop{true};
|
|
|
|
|
|
|
|
while (continueLoop) {
|
|
|
|
// startup() presents the user with the choices below, which are then stored and used by other functions.
|
|
|
|
// The other functions should handle invalid choices.
|
|
|
|
// ((1. Change pin || 2. Change money || 3. Change account name || Q. Exit the program))
|
|
|
|
char userChoice{AtmAdmin::startup()};
|
|
|
|
|
|
|
|
// userInformation will later store information for the XML entry to save.
|
|
|
|
std::string userInformation{};
|
|
|
|
|
|
|
|
// Always returns true unless 'Q' is entered
|
|
|
|
continueLoop = handleUserInformation(static_cast<char>(std::tolower(userChoice)), userInformation);
|
|
|
|
|
|
|
|
std::cout << userInformation << '\n'; // DEBUG
|
|
|
|
}
|
2025-05-26 09:40:01 +00:00
|
|
|
}
|