Well I'm working with structures and need some help with a program.
Now if the user chooses to deposit more, I need it to add to the last amount entered... But I'm not sure how to go about doing so.
#include <iostream>
using namespace std;
struct the
{
int num;
};
int main()
{
char g;
the account = {10};
the check;
do
{
cout<<"your account balance is $"<< account.num<<endl;
cout<<"enter amount you wish to deposite..."<<endl;
cin >>check.num;
cout <<" total balance is now "<< check.num + account.num<<endl;
cout <<" would you like to deposite more? y for yes, n for no"<<endl;
cin >> g;
cout << endl;
}
while (g=='y');
return 0;
}