954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

can somebody limit this program up to 3 users??(c++)

i wrote it in c++,so it just giving me the matrix.
#include

using namespace std;

int main()
{
int account;
do
{

float startBalance, endBalance, allowed, credits, charges;

cout << "Enter account number: ";
cin >> account;

cout << "Enter beginning balance: ";
cin >> credits;

cout << "Enter total charges: ";
cin >> charges;

cout << "Enter total credits: ";
cin >> startBalance;

cout << "Credit limit?: ";
cin >> allowed;

endBalance = startBalance + charges - credits;
if (endBalance > allowed)
cout << "Credit limit exceeded";
}
while (account != -1);

cout<<"enter account number (-1 to end)"<

ze_viru$
Newbie Poster
21 posts since May 2004
Reputation Points: 14
Solved Threads: 0
 

what do you mean by 3 useres ? if you mean that you want the program take input from 3 useres in the same time ! i think that it is good to use structure by this information like
struct account
{
float startBalance, endBalance, allowed, credits, charges;
}. .... then complete
okay :cheesy:

meabed
Junior Poster
Team Colleague
139 posts since May 2004
Reputation Points: 55
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You