#include #include #include "AtmAdmin.h" bool handleUserInformation(char choice, std::string& information) { switch (choice) { case '1': // Implement a proper function for entering a new pin. // The function should have a somewhat complex algorithm that forces the pin to be secure, and unique. // It should also enforce 4 numbers. // Code below is a placeholder. std::cout << "Enter new pin: "; std::cin >> information; break; case '2': // Implement a function for entering a new username. // The function should check if the name isn't already taken. If it is, return to start. // It will also use an algorithm to check if it's a valid username // This includes no spaces and no starting numbers. // Ensure that the name is also converted to fully lowercase. // Code below is a placeholder std::cout << "Enter your new username: "; std::cin >> information; break; case '3': // Simply a way to cheat, very straight-forward. // Code below is a placeholder std::cout << "Enter the amount you wish to have: "; std::cin >> information; break; case 'q': return false; default: std::cout << "Invalid choice.\n"; } return true; } int main() { 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(std::tolower(userChoice)), userInformation); std::cout << userInformation << '\n'; // DEBUG } }