while(cash < w)
{
cout<<"You tryen to rob me? You don't have that much"<<endl
<<"How Much would you like to withdraw?"<<endl<<"$ ";
cin>>w;
}
return cash -= w;
}
double setDeposit(double d)
{
while(d > 10000)
{
cout<<"I would be all about taking more than $10,000 from you and all, "
<<"but it jacks the program up and robs you."<<endl
<<"How much would you like to deposit?"<<endl<<"$ ";
cin>>d;
}
return cash += d;
}
int main()
{
ifstream database;
database.open("bank.txt");
int ui;
int ui2;
int tempPin;
int totalUsers = 0;
int activeUser = 0;
double tempCash;
double withdraw;
double deposit;
string tempId;
string tempFirstName;
string tempLastName;
User users[100];
while (!database.eof())
{
database >> tempId >> tempFirstName >> tempLastName >> tempPin >> tempCash; //get input from file
User tempUser(tempId, tempFirstName, tempLastName, tempPin, tempCash); //use constructor to create a temp object
users[totalUsers] = tempUser; //assign temp object to a spot in our array
totalUsers++; //increment count for the next item
}
database.close();
do
{
cout<<"Welcome to da bank yo."<<endl
<<"Please enter your user id: ";
cin>>tempId;//get user id
cout<<"Please enter your 4-digit numerical pin: ";
cin>>tempPin;//get user pin
cout<<"Welcome back "<<users[activeUser].getFirstName()<<" "<<users[activeUser].getLastName()<<", What would you like to do?"<<endl;
cout<<"1) View Account Info"<<endl
<<"2) Withdraw"<<endl
<<"3) Deposit"<<endl
<<"4) Change Pin"<<endl
<<"5) Quit"<<endl<<endl
<<"What action would you like to take? ";
cin>>ui;
system("cls");
while (ui != 5)
{
while (ui < 1 || ui > 5)
{
system("cls");
hey there, i m new in c++ world and want help. i want to write a program of equations of motion. the program should be able to solve equations of motion i.e. user can provide values of Vf, Vi , a , t, and S
but user will not some of them, program should decide which equation is suitable and find out remaining variables. its about 3 days i m trying to do it bt i have problm to distinguish known and unknown values and how to use the suitable equation according to data provided.
kindly help me
new to programing but shouldn't this line near the end
1 2 3
{
ui = 5;//exit loop
}
be else (ui == 2;) also removing the curly brace above and below the ui line. I think you are actually declaring ui as 5 not checking the value of it. I could be wrong tho
also when i compiled 119,122,124,126, and 130 also have an error
also the ; on 131 I dont think should be there
hira I am also new to programing but I would check out switch statments and have a display of like 1 known are Vf, Vi and input a formula and solve case 2 a, t input equation and solve , etc.. not sure of the formulas or how many variable are known or I would try to help more
op: please use code tags and cleary define your problem. what are the issues?
hira152: please don't hijack thread. start your own
sly: else statements cant have conditions