Abdulg

[C++] Supermarket simulator game (Awful)

Aug 1st, 2012
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.96 KB | None | 0 0
  1. #define UP_ARROW    72
  2. #define DOWN_ARROW  80
  3. #define RIGHT_ARROW 77
  4. #include <iostream>
  5. #include <conio.h>
  6. #include<iostream>
  7. #include<time.h>
  8. #include<cstdlib>
  9. #include<fstream>
  10. #define _WIN32_WINNT  0x0500
  11. #include <windows.h>
  12. #include <Wincon.h>
  13. #include <string>
  14. #include <algorithm>
  15. #include <iostream>
  16. #include <iomanip>
  17. #include <algorithm>
  18. #include <cctype>
  19. #include <dos.h>
  20. #include <conio.h>
  21. #include "Objidl.h"
  22. #include <iostream>
  23. #include <string>
  24. #include "shlwapi.h"
  25. #include <dos.h>
  26. #define WIN32_LEAN_AND_MEAN
  27. #define WIN32_EXTRA_LEAN
  28. using namespace std;
  29. int Money, Month, Season, Menu, ButtonPress, Bills, TotalStock;
  30. int ElectronicsS, ElectronicsD, ElectronicsP, ChocolatesS, ChocolatesD, ChocolatesP, ToolsS, ToolsD, ToolsP, BeachS, BeachD, BeachP, ClothesS, ClothesD, ClothesP,BackS ,BackD ,BackP, Electronics,Chocolates,Tools,Back,Beach,Clothes, Buying;
  31. int ElectronicsA, ChocolatesA, ToolsA, BeachA, ClothesA, BackA, Spare;
  32. char KeyStroke;
  33.  
  34. int GetRandNumber(int Lowest, int Range)
  35. {
  36.     srand (time(NULL));
  37.     int geez = rand ()% Range + Lowest;
  38.     return geez;
  39. }
  40. int GetInput()
  41. {
  42.     KeyStroke = getch();
  43.     if (KeyStroke == 0 || KeyStroke == -32)
  44.         {
  45.             KeyStroke = getch();
  46.             switch (KeyStroke)
  47.             {
  48.             case UP_ARROW:
  49.                 return 1;
  50.                 break;
  51.             case DOWN_ARROW:
  52.                 return 2;
  53.                 break;
  54.             case RIGHT_ARROW:
  55.                  return 3;
  56.                  break;
  57.             }
  58.     }
  59. }
  60. int GetSeason ()
  61. {
  62.     switch (Month)
  63.     {
  64.     case 1:
  65.         return 4;
  66.         break;
  67.     case 2:
  68.         return 4;
  69.         break;
  70.     case 3:
  71.         return 1;
  72.         break;
  73.     case 4:
  74.         return 1;
  75.         break;
  76.     case 5:
  77.         return 1;
  78.         break;
  79.     case 6:
  80.         return 2;
  81.         break;
  82.     case 7:
  83.         return 2;
  84.         break;
  85.     case 8:
  86.         return 2;
  87.         break;
  88.     case 9:
  89.         return 3;
  90.         break;
  91.     case 10:
  92.         return 3;
  93.         break;
  94.     case 11:
  95.         return 4;
  96.         break;
  97.     }
  98. }
  99. void PrintSeason()
  100. {
  101.     switch(Season)
  102.     {
  103.     case 1:
  104.         cout << "Spring";
  105.         break;
  106.     case 2:
  107.         cout << "Summer";
  108.         break;
  109.     case 3:
  110.         cout << "Autumn";
  111.         break;
  112.     case 4:
  113.         cout << "Winter";
  114.         break;
  115.     }
  116. }
  117. void PrintStuff()
  118. {
  119.     cout << "\t\t\t\t\t\t";
  120.         SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 0xE4 );
  121.         cout << "Month:" << Month << "  Money:" << Money << "  Current Season:";
  122.         PrintSeason();
  123.         cout << " Total Stocks:" << TotalStock << endl;
  124.         SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 0x07 );
  125.         cout << "\t\t\t\t\t\t" << endl;
  126. }
  127. void WhatsInDemand()
  128. {
  129.     int Season = GetSeason();
  130.     switch (Season)
  131.     {
  132.     case 1:
  133.         cout << "Chocolates and gardening tools are currently in high demand" << endl;
  134.         break;
  135.     case 2:
  136.         cout << "Beach equipment is in high demand, back to school and warm clothing are in low demand." << endl;
  137.         break;
  138.     case 3:
  139.         cout << "Back to school is currently in high demand, beach equipment is low" << endl;
  140.         break;
  141.     case 4:
  142.         cout << "Electronics and warm clothes are high, garden tools and beach equipment are low" << endl;
  143.         break;
  144.     }
  145. }
  146. int MenuScreen()
  147. {
  148.     int x = 1;
  149. Lawl:
  150.     PrintStuff();
  151.     if (x < 1)
  152.     {
  153.         x = 10;
  154.     }
  155.     if (x > 10)
  156.     {
  157.         x = 1;
  158.     }
  159.     switch(x)
  160.     {
  161.     case 1:
  162.         cout << ">Buy Electronics and Gifts " << endl;
  163.         cout << "Buy Chocolate " << endl;
  164.         cout << "Buy Gardening tools " << endl;
  165.         cout << "Buy Back to school equipment " << endl;
  166.         cout << "Buy Beach toys " << endl;
  167.         cout << "Buy Warm Clothes " << endl;
  168.         cout << "View Stats " << endl;
  169.         cout << "Exit " << endl;
  170.         cout << "Next month " << endl;
  171.         cout << "View help" << endl;
  172.         cout << endl << endl << endl;
  173.         WhatsInDemand();
  174.  
  175.         ButtonPress = GetInput();
  176.         switch (ButtonPress)
  177.         {
  178.         case 1:
  179.             x--;
  180.             break;
  181.         case 2:
  182.             x++;
  183.             break;
  184.         case 3:
  185.             return 1;
  186.         }
  187.         goto hah;
  188.     case 2:
  189.         cout << "Buy Electronics and Gifts " << endl;
  190.         cout << ">Buy Chocolate " << endl;
  191.         cout << "Buy Gardening tools " << endl;
  192.         cout << "Buy Back to school equipment " << endl;
  193.         cout << "Buy Beach toys " << endl;
  194.         cout << "Buy Warm Clothes " << endl;
  195.         cout << "View Stats " << endl;
  196.         cout << "Exit " << endl;
  197.         cout << "Next month " << endl;
  198.         cout << "View help" << endl;
  199.         cout << endl << endl << endl;
  200.         WhatsInDemand();
  201.         ButtonPress = GetInput();
  202.  
  203.         switch (ButtonPress)
  204.         {
  205.         case 1:
  206.             x--;
  207.             break;
  208.         case 2:
  209.             x++;
  210.             break;
  211.         case 3:
  212.             return 2;
  213.         }
  214.         goto hah;
  215.     case 3:
  216.         cout << "Buy Electronics and Gifts " << endl;
  217.         cout << "Buy Chocolate " << endl;
  218.         cout << ">Buy Gardening tools " << endl;
  219.         cout << "Buy Back to school equipment " << endl;
  220.         cout << "Buy Beach toys " << endl;
  221.         cout << "Buy Warm Clothes " << endl;
  222.         cout << "View Stats " << endl;
  223.         cout << "Exit " << endl;
  224.         cout << "Next month " << endl;
  225.         cout << "View help" << endl;
  226.         cout << endl << endl << endl;
  227.         WhatsInDemand();
  228.  
  229.         ButtonPress = GetInput();
  230.         switch(ButtonPress)
  231.         {
  232.         case 1:
  233.             x--;
  234.             break;
  235.         case 2:
  236.             x++;
  237.             break;
  238.         case 3:
  239.             return 3;
  240.         }
  241.         goto hah;
  242.     case 4:
  243.         cout << "Buy Electronics and Gifts " << endl;
  244.         cout << "Buy Chocolate " << endl;
  245.         cout << "Buy Gardening tools " << endl;
  246.         cout << ">Buy Back to school equipment " << endl;
  247.         cout << "Buy Beach toys " << endl;
  248.         cout << "Buy Warm Clothes " << endl;
  249.         cout << "View Stats " << endl;
  250.         cout << "Exit " << endl;
  251.         cout << "Next month " << endl;
  252.         cout << "View help" << endl;
  253.         cout << endl << endl << endl;
  254.         WhatsInDemand();
  255.  
  256.         ButtonPress = GetInput();
  257.         switch(ButtonPress)
  258.         {
  259.         case 1:
  260.             x--;
  261.             break;
  262.         case 2:
  263.             x++;
  264.             break;
  265.         case 3:
  266.             return 4;
  267.         }
  268.         goto hah;
  269.     case 5:
  270.         cout << "Buy Electronics and Gifts " << endl;
  271.         cout << "Buy Chocolate " << endl;
  272.         cout << "Buy Gardening tools " << endl;
  273.         cout << "Buy Back to school equipment " << endl;
  274.         cout << ">Buy Beach toys " << endl;
  275.         cout << "Buy Warm Clothes " << endl;
  276.         cout << "View Stats " << endl;
  277.         cout << "Exit " << endl;
  278.         cout << "Next month " << endl;
  279.         cout << "View help" << endl;
  280.         cout << endl << endl << endl;
  281.         WhatsInDemand();
  282.         ButtonPress = GetInput();
  283.         switch(ButtonPress)
  284.         {
  285.         case 1:
  286.             x--;
  287.             break;
  288.         case 2:
  289.             x++;
  290.             break;
  291.         case 3:
  292.             return 5;
  293.         }
  294.         goto hah;
  295.     case 6:
  296.         cout << "Buy Electronics and Gifts " << endl;
  297.         cout << "Buy Chocolate " << endl;
  298.         cout << "Buy Gardening tools " << endl;
  299.         cout << "Buy Back to school equipment " << endl;
  300.         cout << "Buy Beach toys " << endl;
  301.         cout << ">Buy Warm Clothes " << endl;
  302.         cout << "View Stats " << endl;
  303.         cout << "Exit " << endl;
  304.         cout << "Next month " << endl;
  305.         cout << "View help" << endl;
  306.         cout << endl << endl << endl;
  307.         WhatsInDemand();
  308.  
  309.         ButtonPress = GetInput();
  310.             switch(ButtonPress)
  311.         {
  312.         case 1:
  313.             x--;
  314.             break;
  315.         case 2:
  316.             x++;
  317.             break;
  318.         case 3:
  319.             return 6;
  320.         }
  321.         goto hah;
  322.     case 7:
  323.         cout << "Buy Electronics and Gifts " << endl;
  324.         cout << "Buy Chocolate " << endl;
  325.         cout << "Buy Gardening tools " << endl;
  326.         cout << "Buy Back to school equipment " << endl;
  327.         cout << "Buy Beach toys " << endl;
  328.         cout << "Buy Warm Clothes " << endl;
  329.         cout << ">View Stats " << endl;
  330.         cout << "Exit " << endl;
  331.         cout << "Next month " << endl;
  332.         cout << "View help" << endl;
  333.         cout << endl << endl << endl;
  334.         WhatsInDemand();
  335.  
  336.         ButtonPress = GetInput();
  337.         switch(ButtonPress)
  338.         {
  339.         case 1:
  340.             x--;
  341.             break;
  342.         case 2:
  343.             x++;
  344.             break;
  345.         case 3:
  346.             return 7;
  347.         }
  348.         goto hah;
  349.     case 8:
  350.         cout << "Buy Electronics and Gifts " << endl;
  351.         cout << "Buy Chocolate " << endl;
  352.         cout << "Buy Gardening tools " << endl;
  353.         cout << "Buy Back to school equipment " << endl;
  354.         cout << "Buy Beach toys " << endl;
  355.         cout << "Buy Warm Clothes " << endl;
  356.         cout << "View Stats " << endl;
  357.         cout << ">Exit " << endl;
  358.         cout << "Next month " << endl;
  359.         cout << "View help" << endl;
  360.         cout << endl << endl << endl;
  361.         WhatsInDemand();
  362.  
  363.         ButtonPress = GetInput();
  364.         switch(ButtonPress)
  365.         {
  366.         case 1:
  367.             x--;
  368.             break;
  369.         case 2:
  370.             x++;
  371.             break;
  372.         case 3:
  373.             return 8;
  374.         }
  375.         goto hah;
  376.     case 9:
  377.         cout << "Buy Electronics and Gifts " << endl;
  378.         cout << "Buy Chocolate " << endl;
  379.         cout << "Buy Gardening tools " << endl;
  380.         cout << "Buy Back to school equipment " << endl;
  381.         cout << "Buy Beach toys " << endl;
  382.         cout << "Buy Warm Clothes " << endl;
  383.         cout << "View Stats " << endl;
  384.         cout << "Exit " << endl;
  385.         cout << ">Next month " << endl;
  386.         cout << "View help" << endl;
  387.         cout << endl << endl << endl;
  388.         WhatsInDemand();
  389.         ButtonPress = GetInput();
  390.         switch(ButtonPress)
  391.         {
  392.         case 1:
  393.             x--;
  394.             break;
  395.         case 2:
  396.             x++;
  397.             break;
  398.         case 3:
  399.             return 9;
  400.         }
  401.         goto hah;
  402.     case 10:
  403.         cout << "Buy Electronics and Gifts " << endl;
  404.         cout << "Buy Chocolate " << endl;
  405.         cout << "Buy Gardening tools " << endl;
  406.         cout << "Buy Back to school equipment " << endl;
  407.         cout << "Buy Beach toys " << endl;
  408.         cout << "Buy Warm Clothes " << endl;
  409.         cout << "View Stats " << endl;
  410.         cout << "Exit " << endl;
  411.         cout << "Next month " << endl;
  412.         cout << ">View help" << endl;
  413.         cout << endl << endl << endl;
  414.         WhatsInDemand();
  415.         ButtonPress = GetInput();
  416.         switch(ButtonPress)
  417.         {
  418.         case 1:
  419.             x--;
  420.             break;
  421.         case 2:
  422.             x++;
  423.             break;
  424.         case 3:
  425.             return 10;
  426.         }
  427. hah:
  428.         system("CLS");
  429.         goto Lawl;
  430.     }
  431. }
  432. void CalcDemand()
  433. {
  434.     Season = GetSeason();
  435.     switch (Season)
  436.     {
  437.     case 1:
  438.         ElectronicsD = 3;
  439.         ChocolatesD = 6;
  440.         ToolsD = 6;
  441.         BackD = 4;
  442.         BeachD = 4;
  443.         ClothesD = 4;
  444.         break;
  445.     case 2:
  446.         ElectronicsD = 4;
  447.         ChocolatesD = 5;
  448.         ToolsD = 4;
  449.         BackD = 2;
  450.         BeachD = 7;
  451.         ClothesD = 2;
  452.         break;
  453.     case 3:
  454.         ElectronicsD = 4;
  455.         ChocolatesD = 5;
  456.         ToolsD = 5;
  457.         BackD = 7;
  458.         BeachD = 2;
  459.         ClothesD = 5;
  460.         break;
  461.     case 4:
  462.         ElectronicsD = 7;
  463.         ChocolatesD = 5;
  464.         ToolsD = 2;
  465.         BackD = 4;
  466.         BeachD = 2;
  467.         ClothesD = 7;
  468.         break;
  469.     }
  470. }
  471. void CalcPrices()
  472. {
  473.     CalcDemand();
  474.     Spare = GetRandNumber(16,2);
  475.     ElectronicsP = ElectronicsD * Spare;
  476.     Spare = GetRandNumber(4,2);
  477.     ChocolatesP = ChocolatesD * Spare;
  478.     Spare = GetRandNumber(7,3);
  479.     ToolsP = ToolsD * Spare;
  480.     Spare = GetRandNumber(6,2);
  481.     BackP = BackD * Spare;
  482.     Spare = GetRandNumber(5,3);
  483.     BeachP = BeachD * Spare;
  484.     Spare = GetRandNumber(16,2);
  485.     ClothesP = ClothesD * Spare;
  486. }
  487. void CalcSpeed()
  488. {
  489.     CalcDemand();
  490.     ElectronicsS = ElectronicsD * GetRandNumber(12,3);
  491.     ChocolatesS = ChocolatesD * GetRandNumber(15,4);
  492.     ToolsS = ToolsD * GetRandNumber(13,3);
  493.     BackS = BackD * GetRandNumber(13,3);
  494.     BeachS = BeachD * GetRandNumber(13,3);
  495.     ClothesS = ClothesD * GetRandNumber(15,3);
  496. }
  497. int main ()
  498. {
  499.     HWND hWnd = GetConsoleWindow();
  500.     ShowWindow(hWnd,SW_SHOWMAXIMIZED);  
  501.     HANDLE hOut;
  502.     COORD NewSBSize;
  503.     SMALL_RECT Area = {0, 0, 0, 0};
  504.     hOut = GetStdHandle(STD_OUTPUT_HANDLE);
  505.     NewSBSize = GetLargestConsoleWindowSize(hOut);
  506.     SetConsoleScreenBufferSize(hOut, NewSBSize);
  507.     Area.Right = NewSBSize.X - 1;
  508.     Area.Bottom = NewSBSize.Y - 1;
  509.     SetConsoleWindowInfo(hOut, TRUE,  &Area);
  510.     Money = 50000;
  511.     Month = 1;
  512.     Electronics,Chocolates,Tools,Back,Beach,Clothes = 0;
  513.     cout << "I would highly reccomend reading the help file if this is your first time playing!" << endl;
  514.     Start:
  515.     TotalStock = Electronics + Chocolates + Tools + Back + Beach + Clothes;
  516.     Season = GetSeason();
  517.     CalcDemand();
  518.     CalcSpeed();
  519.     CalcPrices();
  520.     int Menu = MenuScreen();
  521.     switch(Menu)
  522.     {
  523.     case 1:
  524.         Electronics:
  525.         system("CLS");
  526.         PrintStuff();
  527.         cout << "How much electronics stock would you like to buy?" <<  endl << "Electronics are currently " << ElectronicsP <<", so you can buy at max " << Money / ElectronicsP << endl << ">";
  528.         cin >> Buying;
  529.         if (Buying * ElectronicsP > Money)
  530.         {
  531.             cout << endl << "You don't have enough money to do that!" << endl;
  532.             goto Electronics;
  533.         }
  534.         Electronics = Electronics + Buying;
  535.         Money = Money - (Buying * ElectronicsP);
  536.         cout << "You bought " << Buying << " for " << ElectronicsP * Buying << "!" << endl;
  537.         system("PAUSE");
  538.         break;
  539.     case 2:
  540.         Chocolates:
  541.         system("CLS");
  542.         PrintStuff();
  543.         cout << "How much Chocolates stock would you like to buy?" <<  endl << "Chocolates are currently " << ChocolatesP <<", so you can buy at max " << Money / ChocolatesP << endl << ">";
  544.         cin >> Buying;
  545.         if (Buying * ChocolatesP > Money)
  546.         {
  547.             cout << endl << "You don't have enough money to do that!" << endl;
  548.             goto Chocolates;
  549.         }
  550.         Chocolates = Chocolates + Buying;
  551.         Money = Money - (Buying * ChocolatesP);
  552.         cout << "You bought " << Buying << " for " << ChocolatesP * Buying << "!" << endl;
  553.         system("PAUSE");
  554.         break;
  555.     case 3:
  556.         Tools:
  557.         system("CLS");
  558.         PrintStuff();
  559.         cout << "How much Tools stock would you like to buy?" <<  endl << "Tools are currently " << ToolsP <<", so you can buy at max " << Money / ToolsP << endl << ">";
  560.         cin >> Buying;
  561.         if (Buying * ToolsP > Money)
  562.         {
  563.             cout << endl << "You don't have enough money to do that!" << endl;
  564.             goto Tools;
  565.         }
  566.         Tools = Tools + Buying;
  567.         Money = Money - (Buying * ToolsP);
  568.         cout << "You bought " << Buying << " for " << ToolsP * Buying << "!" << endl;
  569.         system("PAUSE");
  570.         break;
  571.     case 4:
  572.         Back:
  573.         system("CLS");
  574.         PrintStuff();
  575.         cout << "How much Back to school stock would you like to buy?" <<  endl << "Back to school stocks are currently " << BackP <<", so you can buy at max " << Money / BackP << endl << ">";
  576.         cin >> Buying;
  577.         if (Buying * BackP > Money)
  578.         {
  579.             cout << endl << "You don't have enough money to do that!" << endl;
  580.             goto Back;
  581.         }
  582.         Back = Back + Buying;
  583.         Money = Money - (Buying * BackP);
  584.         cout << "You bought " << Buying << " for " << BackP * Buying << "!" << endl;
  585.         system("PAUSE");
  586.         break;
  587.     case 5:
  588.         Beach:
  589.         system("CLS");
  590.         PrintStuff();
  591.         cout << "How much Beach stock would you like to buy?" <<  endl << "Beach equipment stocks are currently " << BeachP <<", so you can buy at max " << Money / BeachP << endl << ">";
  592.         cin >> Buying;
  593.         if (Buying * BeachP > Money)
  594.         {
  595.             cout << endl << "You don't have enough money to do that!" << endl;
  596.             goto Beach;
  597.         }
  598.         Beach = Beach + Buying;
  599.         Money = Money - (Buying * BeachP);
  600.         cout << "You bought " << Buying << " for " << BeachP * Buying << "!" << endl;
  601.         system("PAUSE");
  602.         break;
  603.     case 6:
  604.         Clothes:
  605.         system("CLS");
  606.         PrintStuff();
  607.         cout << "How much Clothes stock would you like to buy?" <<  endl << "Clothes equipment stocks are currently " << ClothesP <<", so you can buy at max " << Money / ClothesP << endl << ">";
  608.         cin >> Buying;
  609.         if (Buying * ClothesP > Money)
  610.         {
  611.             cout << endl << "You don't have enough money to do that!" << endl;
  612.             goto Clothes;
  613.         }
  614.         Clothes = Clothes + Buying;
  615.         Money = Money - (Buying * ClothesP);
  616.         cout << "You bought " << Buying << " for " << ClothesP * Buying << "!" << endl;
  617.         system("PAUSE");
  618.         break;
  619.     case 7:
  620.         system("CLS");
  621.         PrintStuff();
  622.         cout << "\tStocks:" << endl;
  623.         cout << "Electronics stock:\t" << Electronics << endl;
  624.         cout << "Chocolate stock:\t" << Chocolates << endl;
  625.         cout << "Gardening stock:\t" << Tools << endl;
  626.         cout << "Stationary stock:\t" << Back << endl;
  627.         cout << "Beach stock:\t\t" << Beach << endl;
  628.         cout << "Warm clothes stock:\t" << Clothes << endl << endl << endl;
  629.         cout << "\tPrices:" << endl;
  630.         cout << "Electronics stock prices:\t" << ElectronicsP << endl;
  631.         cout << "Chocolate stock prices:\t\t" << ChocolatesP << endl;
  632.         cout << "Gardening stock prices:\t\t" << ToolsP << endl;
  633.         cout << "Stationary stock prices:\t" << BackP << endl;
  634.         cout << "Beach stock prices:\t\t" << BeachP << endl;
  635.         cout << "Warm clothes stock prices:\t" << ClothesP << endl << endl << endl;
  636.         WhatsInDemand();
  637.         system("PAUSE");
  638.         break;
  639.     case 8:
  640.         system("PAUSE");
  641.         return 0;
  642.     case 9:
  643.         system("CLS");
  644.         Month++;
  645.         PrintStuff();
  646.         cout << "Monthly report:" << endl;
  647.         if (ElectronicsS> Electronics)
  648.         {
  649.             Money = Money + (Electronics * ElectronicsP) + (ElectronicsD * 3);
  650.             cout << "You sold all your electronics stock!" << endl;
  651.             Electronics = 0;
  652.             goto AElectronics;
  653.         }
  654.         Electronics = Electronics - (ElectronicsS);
  655.         cout << "You sold " << ElectronicsS << " electronics stock, leaving you with " << Electronics << endl;
  656.         Money = Money + (ElectronicsS * ElectronicsP);
  657.         AElectronics:
  658.  
  659.             if (ChocolatesS> Chocolates)
  660.         {
  661.             Money = Money + (Chocolates * ChocolatesP);
  662.             cout << "You sold all your Chocolates stock!" << endl;
  663.             Chocolates = 0;
  664.             goto AChocolates;
  665.         }
  666.         Chocolates = Chocolates - (ChocolatesS);
  667.         cout << "You sold " << ChocolatesS << " Chocolates stock, leaving you with " << Chocolates << endl;
  668.         Money = Money + (ChocolatesS * ChocolatesP);
  669.         AChocolates:
  670.  
  671.             if (ToolsS> Tools)
  672.         {
  673.             Money = Money + (Tools * ToolsP);
  674.             cout << "You sold all your Gardening Tools stock!" << endl;
  675.             Tools = 0;
  676.             goto ATools;
  677.         }
  678.         Tools = Tools - (ToolsS);
  679.         cout << "You sold " << ToolsS << " of your gardening tools stock, leaving you with " << Tools << endl;
  680.         Money = Money + (ToolsS * ToolsP);
  681.         ATools:
  682.  
  683.             if (BackS> Back)
  684.         {
  685.             Money = Money + (Back * BackP);
  686.             cout << "You sold all your Back to school stock!" << endl;
  687.             Back = 0;
  688.             goto ABack;
  689.         }
  690.         Back = Back - (BackS);
  691.         cout << "You sold " << BackS << " Back to school stock, leaving you with " << Back << endl;
  692.         Money = Money + (BackS * BackP);
  693.         ABack:
  694.  
  695.             if (BeachS> Beach)
  696.         {
  697.             Money = Money + (Beach * BeachP);
  698.             cout << "You sold all your Beach stock!" << endl;
  699.             Beach = 0;
  700.             goto ABeach;
  701.         }
  702.         Beach = Beach - (BeachS);
  703.         cout << "You sold " << BeachS << " Beach stock, leaving you with " << Beach << endl;
  704.         Money = Money + (BeachS + BeachP);
  705.         ABeach:
  706.  
  707.             if (ClothesS> Clothes)
  708.         {
  709.             Money = Money + (Clothes * ClothesP);
  710.             cout << "You sold all your Clothes stock!" << endl;
  711.             Clothes = 0;
  712.             goto AClothes;
  713.         }
  714.         Clothes = Clothes - (ClothesS);
  715.         cout << "You sold " << ClothesS << " Clothes stock, leaving you with " << Clothes << endl;
  716.         Money = Money + (ClothesS * ClothesP);
  717.         AClothes:
  718.  
  719.         cout << endl << "You paid " << 100 + (TotalStock/2) << " in bills!" << endl;
  720.         Money = Money - (100 + (TotalStock/2));
  721.         system("PAUSE");
  722.         break;
  723.     case 10:
  724.         system("START C:\\quake\\Help.txt"); // Folder was open
  725.         break;
  726.     }
  727.     system("CLS");
  728.     goto Start;
  729.     system("PAUSE");
  730.     return 0;
  731. }
Advertisement
Add Comment
Please, Sign In to add comment