943,731 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2469
  • C++ RSS
May 17th, 2004
1

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

Expand Post »
i wrote it in c++,so it just giving me the matrix.
#include<iostream>

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)"<<endl;

return 0;
}
Similar Threads
Reputation Points: 14
Solved Threads: 0
Newbie Poster
ze_viru$ is offline Offline
21 posts
since May 2004
May 17th, 2004
0

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

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:
Team Colleague
Reputation Points: 55
Solved Threads: 3
Junior Poster
meabed is offline Offline
139 posts
since May 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Program design (help)
Next Thread in C++ Forum Timeline: Visual C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC