🔒 Closed C++

Status
Not open for further replies.
#include <iostream> #include <string> #include <sstream> using namespace std; string user; string user1="ryan"; string Ltransaction; string Maintransaction ; int AmountToletter; int main() { string choice, transaction; int pin, deposit, amount , balance, withdraw; do { Ltransaction = "" ; cout<<"Welcome to Yalung ATM <24 hrs>"; cout<<"\nEnter Username: "; cin>>user; cout<<"Enter Pincode: "; cin>>pin; if (pin==22 && user==user1) { balance=50000; do { do { cout<<"\nTRANSACTIONS \nD or d - Deposit \nW or w - Withdraw \nB or b - Balance\n"; cout<<"\nEnter Your Transaction: "; cin>>transaction; if (transaction=="D" || transaction=="d") { do { cout<<"Amounts \n1 - 100 \n2 - 200 \n3 - 500 \n4 - 1,000 \n5 - 10,000 \n6 - Others"; cout<<"\nChoose Amount: "; cin>>choice; if (choice=="1") { amount=100; } else if (choice=="2") { amount=200; } else if (choice=="3") { amount=500; } else if (choice=="4") { amount=1000; } else if (choice=="5") { amount=10000; } else if (choice=="6") { cout<<"Enter Amount: "; cin>>amount; } else { cout<<"Invalid\n"; amount=0; } AmountToletter = amount ; Ltransaction = "You Deposit:"; do { cout<<"Enter Pincode: "; cin>>pin; if (pin==22) { deposit=balance+amount; balance=deposit; cout<<"Deposit Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else if (pin==22 && amount==0) { cout<<"Deposit Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else { cout<<"\nInvalid Pin!\n"; } } while (pin!=22); cout<<"\nDeposit again? Yes or No?: "; cin>>choice; } while (choice=="Yes"); } else if (transaction=="W" || transaction=="w") { do { cout<<"Amounts\n1 - 100\n2 - 200\n3 - 500\n4 - 1,000\n5 - 10,000\n6 - Others"; cout<<"\nChoose Amount: "; cin>>choice; if (choice=="1") { amount=100; } else if (choice=="2") { amount=200; } else if (choice=="3") { amount=500; } else if (choice=="4") { amount=1000; } else if (choice=="5") { amount=10000; } else if (choice=="6") { cout<<"Enter Amount: "; cin>>amount; if (amount>balance) { cout<<"MACHINE NOW TERMINATING.....\n"; } } else { cout<<"Invalid\n"; amount=0; } do { cout<<"Enter Pincode: "; cin>>pin; if (pin==22) { if (amount<=balance) { withdraw=balance-amount; balance=withdraw; cout<<"Withdraw Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else if (amount>balance) { cout<<"Withdraw Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else if (amount==0) { cout<<"Withdraw Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } } else { cout<<"\nInvalid Pin!!!!\n"; } } while (pin!=22); cout<<"\nWithdraw again? Yes or No?: "; cin>>choice; } while (choice=="Yes"); AmountToletter = amount ; Ltransaction = "You Withdraw:" ; } else if (transaction=="B" || transaction=="b") { cout<<"Your Balance is: "<<balance<<'\n'; AmountToletter = balance ; Ltransaction = "You balance:"; } else { cout<<"INVALID TRANSACTION!!\n"; } stringstream number ; number << AmountToletter << endl ; string newString = number.str(); Maintransaction = Maintransaction + Ltransaction + newString ; } while (((transaction!="D" && transaction!="d") && (transaction!="W" && transaction!="w")) && (transaction!="B" && transaction!="b")); cout<<"\nAnother Transaction? Yes or No: "; cin>>choice; if (choice == "No" || choice == "no"){ cout << "****** Last transaction*******\n"; cout << Maintransaction ; cout << "\n******************************" ; cout<<"\nTHANK YOU FOR BANKING WITH US!!"; } } while (choice=="Yes" || choice == "yes"); } } while ((user!=user1 || pin!=22) ); return 0; }
 
#include <iostream> #include <string> #include <sstream> using namespace std; string user; string user1="ryan"; string Ltransaction; string Maintransaction ; int AmountToletter; int main() { string choice, transaction; int pin, deposit, amount , balance, withdraw; do { Ltransaction = "" ; cout<<"Welcome to Yalung ATM <24 hrs>"; cout<<"\nEnter Username: "; cin>>user; cout<<"Enter Pincode: "; cin>>pin; if (pin==22 && user==user1) { balance=50000; do { do { cout<<"\nTRANSACTIONS \nD or d - Deposit \nW or w - Withdraw \nB or b - Balance\n"; cout<<"\nEnter Your Transaction: "; cin>>transaction; if (transaction=="D" || transaction=="d") { do { cout<<"Amounts \n1 - 100 \n2 - 200 \n3 - 500 \n4 - 1,000 \n5 - 10,000 \n6 - Others"; cout<<"\nChoose Amount: "; cin>>choice; if (choice=="1") { amount=100; } else if (choice=="2") { amount=200; } else if (choice=="3") { amount=500; } else if (choice=="4") { amount=1000; } else if (choice=="5") { amount=10000; } else if (choice=="6") { cout<<"Enter Amount: "; cin>>amount; } else { cout<<"Invalid\n"; amount=0; } AmountToletter = amount ; Ltransaction = "You Deposit:"; do { cout<<"Enter Pincode: "; cin>>pin; if (pin==22) { deposit=balance+amount; balance=deposit; cout<<"Deposit Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else if (pin==22 && amount==0) { cout<<"Deposit Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else { cout<<"\nInvalid Pin!\n"; } } while (pin!=22); cout<<"\nDeposit again? Yes or No?: "; cin>>choice; } while (choice=="Yes"); } else if (transaction=="W" || transaction=="w") { do { cout<<"Amounts\n1 - 100\n2 - 200\n3 - 500\n4 - 1,000\n5 - 10,000\n6 - Others"; cout<<"\nChoose Amount: "; cin>>choice; if (choice=="1") { amount=100; } else if (choice=="2") { amount=200; } else if (choice=="3") { amount=500; } else if (choice=="4") { amount=1000; } else if (choice=="5") { amount=10000; } else if (choice=="6") { cout<<"Enter Amount: "; cin>>amount; if (amount>balance) { cout<<"MACHINE NOW TERMINATING.....\n"; } } else { cout<<"Invalid\n"; amount=0; } do { cout<<"Enter Pincode: "; cin>>pin; if (pin==22) { if (amount<=balance) { withdraw=balance-amount; balance=withdraw; cout<<"Withdraw Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else if (amount>balance) { cout<<"Withdraw Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } else if (amount==0) { cout<<"Withdraw Amount: "<<amount<<"\nYour Current Balance is: "<<balance; } } else { cout<<"\nInvalid Pin!!!!\n"; } } while (pin!=22); cout<<"\nWithdraw again? Yes or No?: "; cin>>choice; } while (choice=="Yes"); AmountToletter = amount ; Ltransaction = "You Withdraw:" ; } else if (transaction=="B" || transaction=="b") { cout<<"Your Balance is: "<<balance<<'\n'; AmountToletter = balance ; Ltransaction = "You balance:"; } else { cout<<"INVALID TRANSACTION!!\n"; } stringstream number ; number << AmountToletter << endl ; string newString = number.str(); Maintransaction = Maintransaction + Ltransaction + newString ; } while (((transaction!="D" && transaction!="d") && (transaction!="W" && transaction!="w")) && (transaction!="B" && transaction!="b")); cout<<"\nAnother Transaction? Yes or No: "; cin>>choice; if (choice == "No" || choice == "no"){ cout << "****** Last transaction*******\n"; cout << Maintransaction ; cout << "\n******************************" ; cout<<"\nTHANK YOU FOR BANKING WITH US!!"; } } while (choice=="Yes" || choice == "yes"); } } while ((user!=user1 || pin!=22) ); return 0; }
kuya meron ka pa pang ibang program dyan nag aaral pa kasi ako sa java at trtry ko palang e convert to sa java salamat pala.
 
walanjo kayo. source code na mismo hinihingi nyo e. Bakit ayaw nyo gawin ng sarili nyo? Di kayo magiging magaling na developer/programmer nyan pag ganyan
 
Status
Not open for further replies.

About this Thread

  • 13
    Replies
  • 548
    Views
  • 6
    Participants
Last reply from:
PHC-Bill Gates

Online now

Members online
1,020
Guests online
1,433
Total visitors
2,453

Forum statistics

Threads
2,277,055
Posts
28,973,977
Members
1,229,699
Latest member
Joffer2026
Back
Top