Snack Vending Machine help.

Pages: 12
actually i didnt ask.

And apparently you can't read. My handle is not Oria, and I haven't been following that silly thread since the first two pages.

my point is, we all make mistakes so there is no need to "keep hitting me over the head with the hammer"

My point is, you keep making the same mistake, and hitting you over the head with a hammer seems to be the only way to get through to you. Like.. did you bother to verify that I was the person who responded to you in that thread? Even after you went back and looked the thread up? Do you ever check your assumptions?

it was a tiny mistake based off a valid assumption that you can "overload main because doing so would have no effect on main itself".

Again, the initial mistake is not the issue. That you tell other people they are wrong because it differs from what you believe (with no basis) to be true without lifting a finger to check to see if your belief is true, is the problem I'm referring to which you repeat and repeat... and repeat.
Well anyway, I've went ahead and done that, but I'm again in the same position as I was in the 2nd post. :/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <cstdlib>
#include <iostream>

using namespace std;
double beverage = 5.00;
double candy = 2.25;
double hotdog = 7.00;
double popcorn = 6.75;
const int shutdown = 76087;
const int CUSTOMER = 1000;

int main(int argc, char*argv[], int pin, int snack, int tender, int counter, int cost)

{
do
{  
    do
    {
    pin = 0;
    system("cls");   
    cout << "Welcome to Movie Food";
    cout << "\nEnter your 5-digit pin code: ";
    cin >> pin;
    cin.clear(); cin.ignore(10, '\n');
    }
    while(pin < 10000 || pin > 99999);
    if(pin == shutdown){break;}
    do
    {
    snack = '\n';
    system("cls");
    cout << "Select a Snack\n"
    << "B - Beverage $5.00\n"
    << "C - Candy $2.25\n"
    << "H - Hot Dog $7.00\n"
    << "P - Popcorn $6.75\n"
    << "Q - Quit" << endl;
    cin >> snack;
    snack = toupper(snack);
    } 
    while(snack != 'B' && snack != 'C' && snack != 'H' && snack != 'P' && snack != 'Q');
    if(snack == 'Q'){continue;}
    counter++;
    cout << "\nYou selected";
    switch(snack)
    {
                 case 'B': cout << "Beverage" << endl; cost = beverage; break;
                 case 'C': cout << "Candy" << endl; cost = candy; break;
                 case 'H': cout << "Hot Dog" << endl; cost = hotdog; break;
                 case 'p': cout << "Popcorn" << endl; cost = popcorn; break;
    }
    do
    {
                 cout << "Deposit" << cost << "\nEnter amount tendered ";
                 cin >> tender;
                 cin.clear(); cin.ignore(10, '\n');
                 cost = cost - tender;
    }
    while(cost > 0);
    cost = abs(cost);
    if(cost > 0);
    {cout << "Change returned: " << cost << endl;}
    system("PAUSE");
{
    while(counter != CUSTOMER);
    cout << endl;
    cout << "This unit is shutting down to replenish its resources" << endl << endl;
    system("PAUSE");
    return 0;
}
}
}
Um, no. You're still trying to define a main function that takes 7 arguments. That's not legal, as we've explained.
Topic archived. No new replies allowed.
Pages: 12