I need some help with my project

I'd like to ask some professionals who can help me with a program project. For example, ATM machine program. But mine isn't actually an ATM program, I am just stuck on my code so I need someone to help me with this. I'll send the code to you if you are confident to help me on this, I'm willing to spend all my time for this project. Anyone who wants to help?
I suggest you post the code, inside of code tags, and then ask specific questions about your code. I doubt you'll get too many people to give you free one on one tutoring here.
@jlb, this is my code: http://pastebin.com/YJp7hzVn
I can't seem to work on the loop for case 1. So I tried to put a "goto".

Rule:

In case 1: at the if-else statment:

Would you like to try another transaction? [y/n]

If yes, it will go outside the loop and try another type of transaction.
If no, it should continue the CURRENT transaction unless your choice changes to a "yes".
Your code isn't very long it would have been better to post it inline:

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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
	

    #include <iostream>
    #include <conio.h>
    #include <string.h>
    using namespace std;
     
    struct Item
    {
        int prod_left;              
        const char *name;          
    };
     
    Item inventory[] = {                        // Each product has 100 stocks.
        { 100, "Bottled Water" },
        { 100, "Bottled Juice" },
        { 100, "Snow Cone" },
        { 100, "Iced Tea" },
        { 100, "Iced Coffee" },
        { 100, "Ice Cream" },
        { 100, "Milk Shake"},
        { 100, "Chocolate Shake" },
        { 100, "Buko Shake" },
        { 100, "Halo-Halo" },
        { 0, NULL}
        };
    void getSale(int &prod, int &quantity, float &price)
    {
        for (int i=0; inventory[i].name; ++i) {
            printf("\t %d -> \t %s", i+1, inventory[i].name);
            ++i;
            if (inventory[i].name == NULL) break;
     
            printf("\t%d -> %s\n", i+1, inventory[i].name);
        }
        cout << ("\nProduct Code: ");
        cin >> prod;
        --prod;
        printf("Quantity: ");
        scanf("%d", &quantity);
        printf("Price: ");
        scanf("%f", &price);
        inventory[prod].prod_left -= quantity;
    };
    void reportInventory(int prod)            // Warns the user if stock is lower than 70.
    {                                        //  Also warns if stock is equak to 0, which is sold out.
        if (inventory[prod].prod_left >= 70)
        {
            cout << "\n Products Left: " << inventory[prod].prod_left;
        }
        else if (inventory[prod].prod_left <= 70 && inventory[prod].prod_left >=1 )
        {
            cout << "\n\n\t\t============WARNING=================\nProduct Shortage: " <<  inventory[prod].prod_left << " products left.";
        }
        else if (inventory[prod].prod_left == 0)
        {
         printf("\n\n\t\t============WARNING=================\nProduct sold out, will be out of stock.");
        }
    }
     
    int
    main()
    {
        int trans, sum, i, e, count = 0, sales, answer;
        int prod;
        int quantity;
        int bulk_disc;
        float price;        
        float total_sale;  
        float disc_price;  
        float prod_left;    
     
        cout << "\t =================================================\n";
        cout << "\t|                                                 |\n";
        cout << "\t|                W E L C O M E                    |\n";
        cout << "\t|                    T O                          |\n";
        cout << "\t|                C O O L E R S                    |\n";
        cout << "\t|                                                 |\n";
        cout << "\t =================================================\n\n";
          cout << "Guidline for users: \n\n\n Transaction\n\n\ 1 ->Discounted Transaction\n 2 ->Normal Transaction\n 3 ->Bulk Order Transact\
    ion\n 4 ->INVENTORY\n 5 ->Record Sale";
        cout << "\n\n Enter Transaction Number: ";
     
        cin >> trans;
     
        switch (trans)
        {
        case 1:
            repeat:
            cout << "DISCOUNTED TRANSACTION\n";
            getSale(prod, quantity, price);
            total_sale = quantity * price;
            disc_price = total_sale - (total_sale * .20);
            if (inventory[prod].prod_left < 0)
            {
            cout << "\nQuantity is too high, will be out of stock.";
            break;
            }
            else if(inventory[prod].prod_left >=0)
            {
            printf("\nTotal product to be sold: %d", quantity);
            printf("\n\nTotal price = %.2f", disc_price);
            reportInventory(prod);
            }
            cout << "\n\nWould you like to try another transaction? [y/n]";
            getline(cin, answer) >> answer;
            if(answer == 'y')
            {
             goto repeat;
            }
            else if (answer == 'n')
            {
             cout << "Transaction finished.";    
            }
            break;
           
        case 2:
           
            cout << "NORMAL TRANSACTION\n";
            getSale(prod, quantity, price);
            total_sale = quantity * price;
            cout << "\nTotal product to be sold: " << quantity;
            cout << "\n\nTotal price = %.2f" << total_sale;
            reportInventory(prod);
            break;
        }
        getch();
    }


Now you need to ask specific questions based on that code.

Also I suggest you stop using the goto, use one of the other more accepted loops instead.
Sorry, it's because I haven't done all the cases. I will need case 4 and 5 for tables to monitor the stocks deducted, sold, and the available stocks for EACH product. Can you help me finish it.
The code you posted doesn't seem to work, though...
That's your code, I just copied it from your link.

Why are you mixing C-stdio functions and C++ streams? This is C++ so stick with the C++ streams.

Topic archived. No new replies allowed.