| | |
a department-store customer progam
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2007
Posts: 30
Reputation:
Solved Threads: 0
hello everyone.
i'm developing a program from a department-store customerhas exceeded the credit limit on a charge account.for each of the following facts are available.account no,balance of the begining of the month,i total of all items charged by this customer,total of all credit applied to this customer.'m required to instal all the items using while loop.
so what i did is,
int enterInfo=0;
while(enterInfo<5) (x++);
do{
int account,startBalance,endBalance.allowed,credits,charges;
cout<<"enter account number";
cin>>account;
cout<<"enter credits applied to account";
cin>>credits;
cout<<"enter credit card charges";
cin>>charges;
cout<<"enter starting balance";
cin>>startbalance;
cout >>"credit limit?";
cin>>allowed;
so i don't know how to proceed and ene the program please someone help
i'm developing a program from a department-store customerhas exceeded the credit limit on a charge account.for each of the following facts are available.account no,balance of the begining of the month,i total of all items charged by this customer,total of all credit applied to this customer.'m required to instal all the items using while loop.
so what i did is,
int enterInfo=0;
while(enterInfo<5) (x++);
do{
int account,startBalance,endBalance.allowed,credits,charges;
cout<<"enter account number";
cin>>account;
cout<<"enter credits applied to account";
cin>>credits;
cout<<"enter credit card charges";
cin>>charges;
cout<<"enter starting balance";
cin>>startbalance;
cout >>"credit limit?";
cin>>allowed;
so i don't know how to proceed and ene the program please someone help
you probably want to create a structure to hold the data for each customer so that the values will not disappear on each iteration of the do-loop. Then you will need an array or a linked list of those structures. After entering the account number search the array or list for the structure that contains that account number. If found then adjust the members of the structure with the values you enter in the do-loop. If the structure is not in the list, fill out a new structure and add it to the array or list.
I told Santa what I wanted for Christmas and he washed my mouth out with soap.
•
•
Join Date: Apr 2007
Posts: 103
Reputation:
Solved Threads: 17
to get you started
C++ Syntax (Toggle Plain Text)
struct Customer {<blockquote>int accountNumber;</blockquote><blockquote>double balance;</blockquote><blockquote>int credits;</blockquote><blockquote>int charges;</blockquote><blockquote>Customer(int _accountNumber, double _balance, int _credits, int _charges)</blockquote><blockquote>{<blockquote>accountNumber = _accoutnNumber;</blockquote><blockquote>balance = _balance;</blockquote><blockquote>credits = _credits;</blockquote><blockquote>charges = _charges;</blockquote>} Show() {<blockquote>cout << accountNumber << '\n' << balance << '\n' << credits << '\n' << charges << '\n';</blockquote>} </blockquote>}; int main() { <blockquote>Customer customer1 = new Customer(003593, 45000, 3, 15);</blockquote><blockquote>customer1.Show()</blockquote><blockquote>return 0;</blockquote>}
Last edited by mariocatch; May 13th, 2007 at 3:02 pm.
There are many options available to you. Personally, I would suggest using classes over structs in c++, as you can also define private member functions.
If you are using an array of objects don't forget to clear up after with delete[]. You could also use a vector of objects.
But the most important thing is, if you had to ask what they are, you probably need to read up on them before even attempting to integrate their usage in your current program.
If you are using an array of objects don't forget to clear up after with delete[]. You could also use a vector of objects.
But the most important thing is, if you had to ask what they are, you probably need to read up on them before even attempting to integrate their usage in your current program.
*Voted best profile in the world*
![]() |
Similar Threads
- frustrated newbie needs help (C++)
- Very easy problem- i can't seem to get (VB.NET)
- Need help with a vb.net project (VB.NET)
- C++ help (C++)
Other Threads in the C++ Forum
- Previous Thread: How To Uswe A For Loop
- Next Thread: Justification
Views: 2113 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






