Machine Problem in C++
Write an ATM program using the Modern C++ approach in programming.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com
If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.
Your support on my channel is highly appreciated.
Thank you very much.
Program Listing
// atm.cpp
// Machine Problem in C++
// Write an ATM program using Modern C++ approach in programming
//
// Mr. Jake Rodriguez Pomperada,MAED-IT,MIT
// Dev C++ 5.11
// www.jakerpomperada.com and www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental Philippines
#include <iostream>
#include <string>
int amount=0,amt=0,a=0,balance=0;
int option=0;
char choice;
std::string name, loop;
void DisplayMenu();
int main () {
std::cout <<"\n\n";
std::cout <<"\tBACOLOD COMMERCIAL BANK ATM MACHINE";
std::cout <<"\n\n";
std::cout << "\tEnter Your Account Name: ";
std::getline(std::cin,name);
int pinNumber = 0;
std::cout << "\tEnter Pin Number Account: ";
std::cin>>pinNumber;
system ("CLS");
do {
std::cout <<"\n\n";
std::cout << "\tBANK ACCOUNT DETAILS";
std::cout <<"\n\n";
std::cout << "\t1. Account Name: " << name <<std::endl;
std::cout << "\t2. Account Balance: " << "PHP " << balance << std::endl <<std:: endl;
DisplayMenu();
std::cout <<"\n";
std::cout << "\tOption: ";
std::cin >> option;
system("cls");
switch (option)
{
case 1:
std::cout <<"\n\n";
std::cout << "\tWITHDRAW AMOUNT: ";
std::cin >>amt;
if (amt<=balance) {
balance -= amt;
}
else {
std::cout <<"\n\n";
std::cout << "\tNOT ENOUGH MONEY" <<"\n\n\n";
std::cout<< "\tDO YOU WANT TO TRY AGAIN? (Y/N): ";
std::cin>>choice;
system("cls");
}
break;
case 2:
std::cout <<"\n\n";
std::cout << "\tDEPOSIT AMOUNT: ";
std::cin >> a;
balance += a;
std::cout << "\tTOTAL ACCOUNT BALANCE IS: " << balance <<"\n\n";
std:: cout<<"\tDO YOU WANT TO TRY AGAIN? (Y/N): ";
std::cin>>choice;
system("cls");
break;
case 3:
std::cout<<"\tDO YOU WANT TO TRY AGAIN? (Y/N): ";
std::cin>>choice;
system("cls");
break;
}
if(choice=='y'||choice=='Y'){
}
else if(choice=='n'||choice=='N'){
break;
}
else{
std::cout<<"\tPlease Choose in Y (Yes) or N (No):";
std::cin>>choice; }
}while(choice!='n'||choice!='N');
std::cout <<"\n\n";
std::cout << "\tEnd of Program\n\n";
system("pause");
std::cout <<"\n";
}
void DisplayMenu()
{
std::cout <<"\n";
std::cout << "\tSELECT YOUR OPTIONS";
std::cout <<"\n\n";
std::cout << "\t[1] WITHDRAW MONEY" <<"\n";
std::cout << "\t[2] DEPOSIT MONEY" << "\n";
std::cout << "\t[3] EXIT" << "\n";
}
No comments:
Post a Comment