Sir Pa help naman dito sa ATM project ko .... ang gusto ko po manyare ay
1.)itatanong niya muna un accountPIN at password tapos ma sasave siya don sa isang folder using ofstream.
2.)Tapos po after niya mag deposit or mag withdraw itatanong niya kung do you want to start a new transaction?Y or N?tas ullit po ulet pero andun parin po un value kung nag deposit siya.
yun nalang po problema ko sana po makatulong kayo .
C++ programming po. Salamat in Advance
#include <iostream>
#include <string>
using namespace std;
void userinput();
void displaybalance(int x);
int depositbalance(int a, int b);
int withdrawSum(int x, int y);
int main()
{
userinput();
}
void userinput()
{
int balance;
int deposit, withdraw, choice;
balance = 0;
int choice1;
cout << "Welcome to J & J ATM Machine\n";
cout << "[1]Display Balance \n";
cout << "[2]Deposit Money:\n";
cout << "[3]Withdraw Money\n";
cout << "[4]Exit;\n";
cout << "Enter your Choice:";
cin >> choice;
while (choice != 4)
{
switch (choice)
{
case 1:
displaybalance(balance);
system("pause");
break;
case 2:
cout << "Your Current Balance is " << balance << endl;
cout << "How much Money you want to deposit:" << endl;
cin >> deposit;
balance = depositbalance(balance, deposit);
cout << "Your newbalance is :" << endl;
cout << balance;
cout << endl;
cout << "Do you want to Continue?" << endl;
cin >> choice;
break;
case 3:
cout << "Your Current Balance is " << balance << endl;
cout << "How much Money do you want to withdraw:" << endl;
cin >> withdraw;
if (withdraw > balance)
cout << "Sorry you don't have enough money to withdraw" << endl;
else
balance = withdrawSum(balance, withdraw);
cout << "You Withdraw :" << withdraw << endl;
cout << "Your newbalance is :" << endl;
cout << balance<<endl;
cout << "Thank You for using J & J ATM machine till next transaction: " << endl;
system("pause");
return;
}
cout << "Enter Your Choice:" << endl;
cin >> choice;
}
}
void displaybalance(int x)
{
cout << "Your Balance is :" <<x<< endl;
}
int depositbalance(int a, int b)
{
int newbalance = a + b;
return newbalance;
}
int withdrawSum(int x, int y)
{
int newbalance = x - y;
return newbalance;
}