Vending Machine Dev C++

  1. Vending Machine C++ Code
  2. Vending Machine Decal Oklahoma

The vending machine C++ code has a problem.

I wanted to call the 'tPrice' variable from the 'chocoSelect' function to 'insertCoin' function, but it does not work.
Same thing as for calling variables 'cChoice, qAMB, qSD, qCS, qCMB, currentTotal' from the 'chocoSelect' function to the 'dispenser' function.

Mar 06, 2007  Here's the deal: I've been working on this little program forever now, and can't seem to get the final little glitches out of it. I am to build a vending machine, using 2 header.h files (one for the cash register and the other for the dispenser), and 2 member function definitions.cpp (one for each).

What should I include for the clrscr() to work?

  • 2 Contributors
  • forum 3 Replies
  • 776 Views
  • 21 Hours Discussion Span
  • commentLatest Postby tinstaaflLatest Post

tinstaafl1,114

Vending Machine C++ Code

A couple of things I noticed:

Firstly, the compiler has to know how to find the functions before you call them, either have them before main in the file or declare them with prototypes.

Secondly, you're passing data to your functions without telling the function how to receive the data(line 223).

MachineMachine

Thirdly, you're trying to use the result of a void function in an assignment statement(line 167).

The only clrscr() function I know of for windows is in the obsolete 'conio.h', which is still supported by some compilers. I think the 'boost' library has a similar function. You can acheive similar results by writing 50 empty lines to the console.

Vending Machine Decal Oklahoma

Vending Machine Dev C++
Edited by tinstaafl