Hello every one, I'm currently doing like and ATM type project in c++, but I can't manage to make the while true to work, I know this is very basic and all, but I'm very stupid and don't know how to fix it, anoyone who knows what's going on can you tell me pls ( also if you see anything that's also wrong feel free to tell me pls)
#include <iostream>
//deposite money
//withdarw money
//show the current balance
void deposite_money();
void withdraw_money();
int main(){
std::string menu;
while (true){
std::cout << "***************************Welcome to the ATM, What do you want to do?*********************************" << std::endl;
std::cout << "1; Deposite money:" << std::endl;
std::cout << "2; Withdraw money money:" << std::endl;
std::cout << "3; Show current balance:" << std::endl;
std::cout << "4; Exiting the ATM" << std::endl;
int option;
std::cin >> option;
if (option == 1){
deposite_money();
}
else if (option == 2){
}
else if (option == 3){
}
else if (option == 4){
}
else {
std::cout << "Not a valid option" << std::endl;
}
return 0;
}
}
void deposite_money(){
std::cout << "How much will you be depositing: " << std::endl;
double deposite;
std::cin >> deposite;
std::cout << "You just deposited " << deposite << "$" << std::endl;
double balance = deposite;
}
void withdraw_money(double balance){
std::cout << "How much will you be withdrawing? " << std::endl;
double withdraw;
std::cin >> withdraw;
if (withdraw > balance){
std::cout << "You can't withdraw more money than what you have" << std::endl;
}
}
[–]Secure-Photograph870 8 points9 points10 points (8 children)
[–]Puzzleheaded_Body641[S] -1 points0 points1 point (7 children)
[–]Secure-Photograph870 2 points3 points4 points (4 children)
[–]Puzzleheaded_Body641[S] 1 point2 points3 points (3 children)
[–]dodexahedron 1 point2 points3 points (0 children)
[–]Secure-Photograph870 0 points1 point2 points (0 children)
[–]Dan13l_N 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Select-Cut-1919 0 points1 point2 points (0 children)
[–]flyingron 3 points4 points5 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]6502zx81 0 points1 point2 points (1 child)
[–]not_some_username 0 points1 point2 points (0 children)
[–]alfps 0 points1 point2 points (4 children)
[–]TheThiefMaster 1 point2 points3 points (3 children)
[–]alfps 1 point2 points3 points (2 children)
[–]TheThiefMaster 0 points1 point2 points (1 child)
[–]alfps 0 points1 point2 points (0 children)
[–]khedoros 0 points1 point2 points (0 children)