From c9ecb24c756b64dbac18ca8354ef09e99595df2d Mon Sep 17 00:00:00 2001 From: theskywinds Date: Wed, 18 Jun 2025 09:34:20 +0200 Subject: [PATCH] Fully finished build. Removed money & changed README.md --- README.md | 16 ++++------------ libs/XMLStorage.h | 2 -- src/AtmAdmin.cpp | 10 +--------- src/main.cpp | 4 ++-- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index c492c03..3cd3433 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,9 @@ An administrative software for use alongside the ATM program at https://www.dragonfocus.dev/TheSkyWinds/ATM-FTXUI-Simulator -## Plan +## Information -This program will allow for the creation of new users, deletion of users, editing of money, changing of pin. -(For the start, simply allow changing the pin & name.) -This program will be terminal-only. - -## Current plans - -- [x] Allow the user to choose different options (Changing pin, name, etc) -- [x] Make a prototype. Allow variables to be stored & displayed. -- [ ] Integrate it into XML. -- [ ] Add a way to create new users. -- [ ] (MAYBE) Add a way to delete users. +This program allows the user to safely change name and PIN. +In the future, I might implement a way to change money and manipulate current users (Creating new ones and deleting old ones) +Additionally, this program ONLY runs purely in the terminal. diff --git a/libs/XMLStorage.h b/libs/XMLStorage.h index 935bff2..49f6d4a 100644 --- a/libs/XMLStorage.h +++ b/libs/XMLStorage.h @@ -16,7 +16,6 @@ namespace AtmAdmin { this->m_data ={initAccountNode(m_search)}; this->name ={m_data.child_value("name") }; - this->money ={std::stod(m_data.child_value("money"))}; this->pin ={m_data.child_value("pin")}; } @@ -26,7 +25,6 @@ namespace AtmAdmin { pugi::xml_node initAccountNode (const std::string& toSearch); std::string name{}; - double money{}; std::string pin{}; private: pugi::xml_document m_doc; diff --git a/src/AtmAdmin.cpp b/src/AtmAdmin.cpp index abd7e61..5f9fbfa 100644 --- a/src/AtmAdmin.cpp +++ b/src/AtmAdmin.cpp @@ -12,7 +12,6 @@ namespace AtmAdmin { enum Choice { PIN, NAME, - MONEY, }; void handleInvalidArguments(int argc) { @@ -21,7 +20,7 @@ namespace AtmAdmin { if (argc < 2) { std::cerr << "The ability to make new accounts is not implemented." << '\n'; - std::cerr << "Please put in a pre-existing name." << std::endl; + std::cerr << "Please put in a pre-existing ID" << std::endl; } else std::cerr << "Too many arguments." << std::endl; @@ -103,13 +102,6 @@ namespace AtmAdmin { return true; } break; - case '3': - // Simply a way to cheat, very straight-forward. - - // The code below is a placeholder - std::cout << "Enter the amount you wish to have: "; - std::cin >> mainStorage.money; - break; case 'q': return false; default: diff --git a/src/main.cpp b/src/main.cpp index cd4fe4a..083cd15 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ char startup() { char choice{}; - std::cout << "1. Change PIN\n" << "2. Change account name\n" << "3. Change money (UNFINISHED)\n" << "Q. Exit the program\n\n"; + std::cout << "1. Change PIN\n" << "2. Change account name\n" << "Q. Exit the program\n\n"; std::cout << ">: "; std::cin >> choice; @@ -29,6 +29,6 @@ int main(int argc, [[maybe_unused]] char** argv) { // Always returns true unless 'Q' is entered. continueLoop = AtmAdmin::handleUserInformation(static_cast(std::tolower(userChoice)), mainStorage); - std::cout << "PIN: " << mainStorage.pin << " || NAME: " << mainStorage.name << " || MONEY: " << mainStorage.money << '\n'; // DEBUG + // std::cout << "PIN: " << mainStorage.pin << " || NAME: " << mainStorage.name << '\n'; // DEBUG } } \ No newline at end of file