![]() |
|
#1
|
|||
|
|||
Help fixing my cash register program.I need help making a simple cash register program which a user inputs a number and the program puts the amount of coins and of what value excluding pennies. for example if i enter 90 it should output 1 of 50, 2 of 20, 0 of 10 and 0 of 5.
i have written two separate programs which both dont work. this one refuses to compile. CPP / C++ / C Code:
and the second compiles but when you enter a number it prints an infinite loop CPP / C++ / C Code:
please can you help me in anyway to fix both. Thanks in advance |
|
#2
|
|||
|
|||
Re: Help fixing my cash register program.often times when a program wont compile there are significant error messages that are spit onto the screen (you will learn to rely heavily on these in the future).
What are the errors you are getting? How have you tried to address them? |
|
#3
|
|||
|
|||
Re: Help fixing my cash register program.Thanks for the reply but the errors im getting are
warning line 34: 'value' is assigned a value that is never used in function DoCalc(int &,int) warning line 28: 'value' is assigned a value that is never used in function DoCalc(int &,int) warning line 22: 'value' is assigned a value that is never used in function DoCalc(int &,int) warning line 16: 'value' is assigned a value that is never used in function DoCalc(int &,int) warning line 11: 'value' is assigned a value that is never used in function DoCalc(int &,int) error line 54: call of nonfunction in function main() i have tried everything but i still cant fix it. |
|
#4
|
|||
|
|||
Re: Help fixing my cash register program.You have an extra set of parenthesis when calling your docalc() function.
|
|
#5
|
|||
|
|||
Re: Help fixing my cash register program.I have the same program to create, but we're fetching from a "transaction.dat" file. Here's what I have so far:
CPP / C++ / C Code:
|
|
#6
|
|||
|
|||
Re: Help fixing my cash register program.With an argument list that large, it would benefit you to wrap all that state into a class - a Register object, say. You are just begging for someone (or yourself) to mix at least one of those up.
|
Recent GIDBlog
Toyota - 2008 November Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help making a simpe cash register program | lil_rom | C Programming Language | 1 | 11-Apr-2008 05:45 |
| Write a C++ program to implement a cash register program | Computeretard66 | C++ Forum | 2 | 29-Feb-2008 09:05 |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| Pipeline freeze simulation | darklightred | C++ Forum | 6 | 27-Jul-2006 20:37 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The