Advertisement
Cnvmendoza

Trading Market w/ Bank

Nov 17th, 2021 (edited)
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 139.08 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <sstream>
  4. #include <cstdlib>
  5. #include <time.h>
  6. #include <cmath>
  7. #include <unistd.h>
  8. #include <windows.h>
  9.  
  10. using namespace std;
  11. //Tax
  12. float tax = 0;
  13. float taxStore = 0;
  14. float taxStore2 = 0;
  15. float taxStore3 = 0;
  16. float taxStore4 = 0;
  17.  
  18. //Taxes
  19. void taxes(void);
  20. void firstBracket(void);
  21. void secondBracket(void);
  22. void thirdBracket(void);
  23. void fourthBracket(void);
  24.  
  25.  
  26. // Banking
  27. //Banking System
  28. float debt = 0;
  29. float bankMoney = 0;
  30. float bankMoney2 = 0;
  31. float interest = 5;
  32. float interest2 = 3;
  33. float loan1 = 0;
  34. float loan2 = 0; //loan2 = 0 once the user has successfully traded.
  35. float lastDeposit = 0;
  36. float lastDeposit2 = 0;
  37. float borrow2 = 0;
  38. int year = 0;
  39.  
  40.  
  41. //Remember Bank
  42. int memBank = 0;
  43. int memLoan = 0;
  44. int memDp = -1;
  45. int memDp2 = 0;
  46. int memDebt = 0;
  47. int loanTurn = 0;
  48.  
  49. //The Bank Function
  50. void theBank(void);
  51. void rules(void);
  52.  
  53. // User Debt Function
  54. void userDebt(void);
  55.  
  56. // Withdraw Function
  57. void withdraw(void);
  58.  
  59. // Deposit Function
  60. void deposit(void);
  61. void reports(void);
  62.  
  63. // Loan Function
  64. void loan(void);
  65. void repay(void);
  66. void borrow(void);
  67. void trust(void);
  68. void trusted(void);
  69. void checkDebt(void);
  70.  
  71. // Compounding Bank Money Function
  72. void compoundBank(void);
  73. // Random Function
  74. float random(float x);
  75. string input;
  76. //Global
  77. //Inventory
  78. int potInv = 0, oilInv = 0, fishInv = 0, woolInv = 0, velvetInv = 0, toolsInv = 0, spiceInv = 0, ironInv = 0, flourInv = 0, dyeInv = 0, leatherInv = 0, furInv = 0, beerInv = 0, saltInv = 0, wineInv = 0;
  79. int qty = 0;    //quantity
  80. int inv = 0;
  81. //User
  82. float balance = 5000;
  83. //Trade Goods Prices, in order: Sweden, Poland
  84. //Escape-add;
  85. float x;
  86. float randomnum = random(x);
  87. float potPrice[7] = {90, 157.5, 157.5, 99, 67.5, 99, 90};
  88. float oilPrice[7] = {400, 300, 700, 700, 440, 440, 400};
  89. float fishPrice[7] = {50, 55, 87.5, 55, 87.5, 55, 50};
  90. float woolPrice[7] = {240, 180, 180, 264, 264, 264, 240};
  91. float velvetPrice[7] = {950, 1662.5, 1662.5, 990, 712.5, 990, 950};
  92. float toolsPrice[7] = {400, 300, 700, 440, 440, 400};
  93. float spicePrice[7] = {800, 1400, 600, 880, 600, 880, 800};
  94. float ironPrice[7] = {220, 365, 365, 365, 165, 242, 220};
  95. float flourPrice[7] = {50, 37.5, 87.5, 55, 87.5, 55, 50};
  96. float dyePrice[7] = {180, 198, 135, 198, 198, 198, 180};
  97. float leatherPrice[7] = {180, 198, 315, 135, 135, 198, 180};
  98. float furPrice[7] = {390, 429, 292.5, 429, 429, 429, 390};
  99. float beerPrice[7] = {100, 75, 175, 175, 175, 110, 100};
  100. float saltPrice[7] = {220, 165, 385, 165, 165, 242, 220};
  101. float winePrice[7] = {200, 220, 150, 220, 220, 220, 200};
  102.  
  103. float price;
  104. float priceArrays[100];
  105. //Country Mem
  106. string country = "None";    //Starting
  107. string place[7] = { "Sweden", "Poland", "Russia", "Crimea", "Saudi Arabia", "Ukraine", "China"};
  108. int land;   //index
  109. //Country Inv (Default inv)
  110. //surplus 200%;
  111. //well-met 100%;
  112. //high 75%; med 50%; low 25%;
  113. int potInvSwede = 150, potInvPol = 50, potInvRus = 100, potInvCri = 75, potInvSau= 150, potInvUkr= 75, potInvChi= 100; //well 100
  114. int oilInvSwede = 25, oilInvPol = 75, oilInvRus = 45, oilInvCri= 25, oilInvSau= 38, oilInvUkr= 38, oilInvChi= 50; //well 50
  115. int fishInvSwede = 150,     fishInvPol = 113,   fishInvRus = 75,    fishInvCri= 113,        fishInvSau = 75,    fishInvUkr = 113,   fishInvChi = 150; //well 75
  116. int woolInvSwede = 75,      woolInvPol = 56,    woolInvRus = 113,   woolInvCri= 56,         woolInvSau = 56,    woolInvUkr = 56,    woolInvChi=75; //well 75
  117. int velvetInvSwede =25,     velvetInvPol = 13,  velvetInvRus = 13,  velvetInvCri = 19,      velvetInvSau=38,    velvetInvUkr = 19,  velvetInvChi=25; //well 25
  118. int toolsInvSwede = 50,     toolsInvPol = 75,   toolsInvRus = 38,   toolsInvCri=38,         toolsInvSau=38,     toolsInvUkr = 38,   toolsInvChi=50; //well 50
  119. int spiceInvSwede = 30,     spiceInvPol = 15,   spiceInvRus = 45,   spiceInvCri= 23,        spiceInvSau= 23,    spiceInvUkr = 23,   spiceInvChi=30; //well 30
  120. int ironInvSwede = 100,     ironInvPol = 50,    ironInvRus = 50,    ironInvCri= 50,         ironInvSau=75,      ironInvUkr = 75,    ironInvChi = 100; //well 100
  121. int flourInvSwede = 150,    flourInvPol = 113,  flourInvRus = 75,   flourInvCri= 113,       flourInvSau= 75,    flourInvUkr = 113,  flourInvChi = 150; //well 150
  122. int dyeInvSwede = 75,       dyeInvPol = 56,     dyeInvRus= 113,     dyeInvCri = 56,         dyeInvSau= 56,      dyeInvUkr = 56,     dyeInvChi = 75; //well 75
  123. int leatherInvSwede = 75,   leatherInvPol = 56, leatherInvRus = 38, leatherInvCri = 113,    leatherInvSau=56,   leatherInvUkr = 56, leatherInvChi = 75; //well 75
  124. int furInvSwede = 75,       furInvPol = 56,     furInvRus = 113,    furInvCri = 56,         furInvSau=56,       furInvUkr = 56,     furInvChi = 75; //well 75
  125. int beerInvSwede =75,       beerInvPol = 113,   beerInvRus = 56,    beerInvCri = 38,        beerInvSau=38,      beerInvUkr = 56,    beerInvChi = 75; //well 75
  126. int saltInvSwede =75,       saltInvPol = 38,    saltInvRus = 56,    saltInvCri = 113,       saltInvSau=113,     saltInvUkr = 56,    saltInvChi = 75; //well 75
  127. int wineInvSwede =75,       wineInvPol = 56,    wineInvRus = 56,    wineInvCri = 113,       wineInvSau=56,      wineInvUkr = 56,    wineInvChi = 75; //well 75
  128.  
  129.  
  130. int inv_Country = 0; // For loop inv
  131. //Goods
  132. string tradeGoods[15] = { "Pottery ", "Oil ", "Fish ", "Wool Cloth ", "Velvet " , "Tools ", "Spices ", "Iron ", "Flour ", "Dyes ", "Leatherworks ", "Fur ", "Beer " , "Salt ", "Wine " };int goodNo;
  133. int goodType;
  134. //int remember strings
  135. int mem = 0;    //inv
  136. int mem2 = 0;   //notes
  137. int mem3 = 0;   //buy/sell
  138. //Turn Counter;
  139. //event variables
  140. int GOOJcard=0; // Get out of jail
  141. int turn=1;
  142. int investment=0;
  143. int event35=0;
  144. int Cauldron=0;
  145. int checkers=0;
  146. //End of Global
  147. //Escape add
  148. void random(void);
  149. //What do I do first?
  150. void loc(void);
  151.  
  152. //User's Inventory
  153. void check(void);
  154.  
  155. //Trade
  156. void trade(void);
  157.  
  158. //Buy function
  159. void buy(void);
  160.  
  161. //traded
  162. void traded(void);
  163.  
  164. //Quantity function
  165. void quantity(void);
  166.  
  167. //lack function
  168. void lack(void);
  169.  
  170. //Sell function
  171. void sell(void);
  172.  
  173. //Goods function
  174. void goods(void);
  175.  
  176. //Notes function
  177. void notes(void);
  178.  
  179. //Balance function
  180. void balance_balance(void);
  181.  
  182. //todo
  183. void todo(void);
  184. void todo2(void);
  185.  
  186. //Country Inventory
  187. void countryInv(void);
  188. void determineCountry(void);
  189. //Turn-based Events
  190. void turnCounter(void);
  191. void eventsNumbers(void);
  192. void events(int random);
  193.  
  194.  
  195.  
  196. main(){
  197.     system("color 70");
  198.     if(balance<0){
  199.         if (bankMoney > 0){
  200.             balance -= 3.50;
  201.             balance += bankMoney;
  202.             bankMoney = 0;
  203.             cout << endl;
  204.             cout << endl;
  205.             cout << "Checking Bank Account . . . ";
  206.             sleep(2);
  207.             cout << endl;
  208.             cout << "Withdrawing Bank Balance.";
  209.             cout << endl;
  210.             cout << "Withdrawal Fee: Eur 3.50";
  211.             cout << endl;
  212.             cout << endl;
  213.             system("pause");
  214.             if (balance <= 0){
  215.                 cout << endl;
  216.                 cout << endl;
  217.                 cout << "You are now bankrupt. Game Over.";
  218.                 cout << endl;
  219.                 cout << "You lasted for "<< turn <<" turns.";
  220.                 cout << endl;
  221.                 cout << endl;
  222.                 cout << endl;
  223.                 exit(0);
  224.             }
  225.         }
  226.         else {
  227.             cout << endl;
  228.             cout << endl;
  229.             cout << "You are now bankrupt. Game Over.";
  230.             cout << endl;
  231.             cout << "You lasted for "<<turn<<" turns.";
  232.             cout << endl;
  233.             cout << endl;
  234.             cout << endl;
  235.             exit(0);
  236.         }
  237.     }
  238.  
  239.     if (turn<=60&&balance>0) loc();
  240.  
  241.     else if (balance>0){
  242.         cout << setprecision(2) << fixed;
  243.         cout<<"Your total money came to:" << balance + bankMoney;
  244.     }
  245.  
  246.     cout << "\nThanks for playing this simulator.";
  247.  
  248.     exit(0);
  249. }
  250.  
  251. //loc function
  252. void loc(void){
  253.     if (turn<60 && checkers==0)
  254.     {
  255.         cout<<"Turn: "<<turn<<endl;
  256.         eventsNumbers();
  257.     }
  258.     else if (turn==60 && checkers==0)
  259.     {
  260.     cout<<"Turn: "<<turn<<" (LAST TURN!)"<<endl;
  261.     eventsNumbers();
  262.     }
  263.     else if (checkers==0)
  264.     {
  265.     main();
  266.     }
  267.     if (balance<0)
  268.     {
  269.     main();}
  270.     if (turn%4==0) taxes();
  271.  
  272.     country = "None";
  273.     int x = 0;
  274.     mem = 0;
  275.     mem2 = 0;
  276.     cout << endl;
  277.     cout << endl;
  278.     balance_balance();
  279.     cout << "             =============================================================================";
  280.     cout << endl;
  281.     cout << setw(37);
  282.     cout << "What do you want to do?";
  283.     cout << endl;
  284.     cout << setw(18);
  285.     cout << "[1] " << setw(17) << "Trade";
  286.     cout << endl;
  287.     cout << setw(18);
  288.     cout << "[2] " << setw(17) << "Check Inventory";
  289.     cout << endl;
  290.     cout << setw(18);
  291.     cout << "[3] " << setw(17) << "Bank";
  292.     cout << endl;
  293.     cout << setw(18);
  294.     cout << "[4] " << setw(17) << "Exit";
  295.     cout << endl;
  296.     cout << "             =============================================================================";
  297.     cout << endl;
  298.     do {
  299.         cout << setw(27);
  300.         cout << "Enter Input: ";
  301.         cin >> input;
  302.         stringstream(input) >> x;
  303.         switch (x)
  304.         {
  305.             case 1:
  306.                 trade();
  307.                 break;
  308.             case 2:
  309.                 checkers=1;
  310.                 check();
  311.                 break;
  312.             case 3:
  313.                 theBank();
  314.                 break;
  315.             case 4:
  316.                 abort();
  317.                 break;
  318.             default:
  319.                 cout << setw(60);
  320.                 cout << "That's an invalid option. Please try again.";
  321.                 cout << endl;
  322.         }
  323.         cout << endl;
  324.     } while (input != "1" || input != "2");
  325. }
  326.  
  327. //check function
  328. void check(void){
  329.     cout << endl;
  330.     cout << setw(33);
  331.     cout << "You currently have:";
  332.     cout << endl;
  333.     cout << setw(20);
  334.     cout << potInv << setw(15) << " - " << setw(17) << " Pottery";
  335.     cout << endl;
  336.     cout << setw(20);
  337.     cout << oilInv << setw(15) << " - " << setw(17) << " Oil";
  338.     cout << endl;
  339.     cout << setw(20);
  340.     cout << fishInv << setw(15) << " - " << setw(17) << " Fish";
  341.     cout << endl;
  342.     cout << setw(20);
  343.     cout << woolInv << setw(15) << " - " << setw(17) << " Wool Cloth";
  344.     cout << endl;
  345.     cout << setw(20);
  346.     cout << velvetInv << setw(15) << " - " << setw(17) << " Velvet";
  347.     cout << endl;
  348.     cout << setw(20);
  349.     cout << toolsInv << setw(15) << " - " << setw(17) << " Tools";
  350.     cout << endl;
  351.     cout << setw(20);
  352.     cout << spiceInv << setw(15) << " - " << setw(17) << " Spice";
  353.     cout << endl;
  354.     cout << setw(20);
  355.     cout << ironInv << setw(15) << " - " << setw(17) << " Iron";
  356.     cout << endl;
  357.     cout << setw(20);
  358.     cout << flourInv << setw(15) << " - " << setw(17) << " Flour";
  359.     cout << endl;
  360.     cout << setw(20);
  361.     cout << dyeInv << setw(15) << " - " << setw(17) << " Dye";
  362.     cout << endl;
  363.     cout << setw(20);
  364.     cout << leatherInv << setw(15) << " - " << setw(17) << " Leatherworks";
  365.     cout << endl;
  366.     cout << setw(20);
  367.     cout << furInv << setw(15) << " - " << setw(17) << " Fur";
  368.     cout << endl;
  369.     cout << setw(20);
  370.     cout << beerInv << setw(15) << " - " << setw(17) << " Beer";
  371.     cout << endl;
  372.     cout << setw(20);
  373.     cout << saltInv << setw(15) << " - " << setw(17) << " Salt";
  374.     cout << endl;
  375.     cout << setw(20);
  376.     cout << wineInv << setw(15) << " - " << setw(17) << " Wine";
  377.     cout << endl;
  378.     cout << setw(38);
  379.     cout << " . . . in your inventory.";
  380.     cout << endl;
  381.     cout << endl;
  382.     system("pause");
  383.     switch (mem){
  384.         case 0:
  385.             checkers=1;
  386.             loc();
  387.             break;
  388.         case 1:
  389.             trade();
  390.             break;
  391.         case 2:
  392.             buy();
  393.             break;
  394.         case 3:
  395.             sell();
  396.             break;
  397.         case 4:
  398.             todo2();
  399.             break;
  400.     }
  401. }
  402.  
  403. //trade function
  404. void trade(void){
  405.     mem = 1;
  406.     string input;
  407.     country = "None";
  408.     mem2 = 1;
  409.     int x;
  410.     cout << endl;
  411.     cout << "             =============================================================================";
  412.     cout << endl;
  413.     cout << setw(28);
  414.     cout << "Country List: ";
  415.     cout << endl;
  416.     cout << "             =============================================================================";
  417.     cout << endl;
  418.     cout << setw(18);
  419.     cout << "[1] " << setw(17) << "Sweden";
  420.     cout << endl;
  421.     cout << setw(18);
  422.     cout << "[2] " << setw(17) << "Poland";
  423.     cout << endl;
  424.     cout << setw(18);
  425.     cout << "[3] " << setw(17) << "Russia";
  426.     cout << endl;
  427.     cout << setw(18);
  428.     cout << "[4] " << setw(17) << "Crimea";
  429.     cout << endl;
  430.     cout << setw(18);
  431.     cout << "[5] " << setw(17) << "Saudi Arabia";
  432.     cout << endl;
  433.     cout << setw(18);
  434.     cout << "[6] " << setw(17) << "Ukraine";
  435.     cout << endl;
  436.     cout << setw(18);
  437.     cout << "[7] " << setw(17) << "China";
  438.     cout << endl;
  439.     cout << setw(18);
  440.     cout << "[8] " << setw(17) << "Check inventory";
  441.     cout << endl;
  442.     cout << setw(18);
  443.     cout << "[9] " << setw(17) << "Check notes";
  444.     cout << endl;
  445.     cout << setw(18);
  446.     cout << "[10] " << setw(17) << "Return";
  447.     cout << endl;
  448.     cout << "             =============================================================================";
  449.     cout << endl;
  450.     do{
  451.         cout << setw(27);
  452.         cout << "Enter Input: ";
  453.         cin >> input;
  454.         stringstream(input) >> x;
  455.         switch (x){
  456. case 1:
  457.                 land = 0; // Sweden
  458.                 todo();
  459.                 break;
  460.             case 2:
  461.                 land = 1; // Poland
  462.                 todo();
  463.                 break;
  464.             case 3:
  465.                 land = 2; // Russia
  466.                 todo();
  467.                 break;
  468.             case 4:
  469.                 land = 3; // Crimea
  470.                 todo();
  471.                 break;
  472.             case 5:
  473.                 land = 4; // Saudi
  474.                 todo();
  475.                 break;
  476.             case 6:
  477.                 land = 5; // Ukraine
  478.                 todo();
  479.                 break;
  480.             case 7:
  481.                 land = 6; // China
  482.                 todo();
  483.                 break;
  484.             case 8:
  485.                 checkers=1;
  486.                 check();
  487.                 break;
  488.             case 9:
  489.                 checkers=1;
  490.                 notes();
  491.                 break;
  492.             case 10:
  493.                 checkers=1;
  494.                 loc();
  495.                 break;
  496.  
  497.             default:
  498.                 cout << setw(60);
  499.                 cout << "That's an invalid option. Please try again.";
  500.                 cout << endl;
  501.                 break;
  502.         }
  503. }while (input != "1" || input != "2" || input != "3" || input != "4" || input != "5" || input != "6"|| input != "7" || input !="8" || input != "9" || input != "10");
  504.         cout << endl;
  505. }
  506.  
  507. //goods function
  508. void goods(void){
  509.     cout << setprecision(2) << fixed;
  510.     cout << endl;
  511.     cout << setw(25);
  512.     cout << "Trade Goods";
  513.     cout << endl;
  514.     cout << "             =============================================================================";
  515.     cout << endl;
  516.     cout << endl;
  517.     random();
  518.     cout << setw(18) << "[16] " << setw(17) << "Check Inventory";
  519.     cout << endl;
  520.     cout << setw(18) << "[17] " << setw(17) << "Check Notes";
  521.     cout << endl;
  522.     cout << setw(18) << "[18] " << setw(17) << "Return";
  523.     cout << endl;
  524.     cout << endl;
  525.     cout << "             =============================================================================";
  526.     cout << endl;
  527.     cout << endl;
  528. }
  529.  
  530. //buy function
  531. void buy(void){
  532.     string input;
  533.     int x;
  534.     mem = 2;
  535.     mem2 = 2;
  536.     mem3 = 0;
  537.     if (land == 0){
  538.         cout << endl;
  539.         cout << setw(48);
  540.         cout << "You are trading with Sweden . . . ";
  541.         cout << endl;
  542.     }
  543.     else if (land == 1){
  544.         cout << endl;
  545.         cout << setw(48);
  546.         cout << "You are trading with Poland . . . ";
  547.         cout << endl;
  548.     }
  549.       else if (land == 2){
  550.         cout << endl;
  551.         cout << setw(48);
  552.         cout << "You are trading with Russia . . . ";
  553.         cout << endl;
  554.     }
  555.    else if (land == 3){
  556.         cout << endl;
  557.         cout << setw(48);
  558.         cout << "You are trading with Crimea . . . ";
  559.         cout << endl;
  560.     }
  561.     else if (land == 4){
  562.         cout << endl;
  563.         cout << setw(54);
  564.         cout << "You are trading with Saudi Arabia . . . ";
  565.         cout << endl;
  566.     }
  567.     else if (land == 5){
  568.         cout << endl;
  569.         cout << setw(49);
  570.         cout << "You are trading with Ukraine . . . ";
  571.         cout << endl;
  572.     }
  573.     else if (land == 6){
  574.         cout << endl;
  575.         cout << setw(47);
  576.         cout << "You are trading with China . . . ";
  577.         cout << endl;
  578.     }
  579.  
  580.     country = "None";
  581.     balance_balance();
  582.     goods();
  583.     cout << setw(39);
  584.     cout << "What do you want to buy? ";
  585.     cout << endl;
  586.     do{
  587.         cout << setw(27);
  588.         cout << "Enter Input: ";
  589.         cin >> input;
  590.         stringstream(input) >> x;
  591.         switch (x){
  592.             case 1:
  593.                 goodType = 0;
  594.                 determineCountry();
  595.                 inv = potInv;
  596.                 price = priceArrays[goodType];
  597.                 quantity();
  598.                 if (balance < qty *price){
  599.                     lack();
  600.                     break;
  601.                 }
  602.                 else if (balance >= qty *price){
  603.                     traded();
  604.                     break;
  605.                 }
  606.  
  607.             case 2:
  608.                 goodType = 1;
  609.                 determineCountry();
  610.                 inv = oilInv;
  611.                 price = priceArrays[goodType];
  612.                 quantity();
  613.                 if (balance < qty *price){
  614.                     lack();
  615.                     break;
  616.                 }
  617.                 else if (balance >= qty *price){
  618.                     traded();
  619.                     break;
  620.                 }
  621.             case 3:
  622.                 goodType = 2;
  623.                 determineCountry();
  624.                 inv = fishInv;
  625.                 price = priceArrays[goodType];
  626.                 quantity();
  627.                 if (balance < qty *price){
  628.                     lack();
  629.                     break;
  630.                 }
  631.                 else if (balance >= qty *price){
  632.                     traded();
  633.                     break;
  634.                 }
  635.             case 4:
  636.                 goodType = 3;
  637.                 determineCountry();
  638.                 inv = woolInv;
  639.                 price = priceArrays[goodType];
  640.                 quantity();
  641.                 if (balance < qty *price){
  642.                     lack();
  643.                     break;
  644.                 }
  645.                 else if (balance >= qty *price){
  646.                     traded();
  647.                     break;
  648.                 }
  649.             case 5:
  650.                 goodType = 4;
  651.                 determineCountry();
  652.                 inv = velvetInv;
  653.                 price = priceArrays[goodType];
  654.                 quantity();
  655.                 if (balance < qty *price){
  656.                     lack();
  657.                     break;
  658.                 }
  659.                 else if (balance >= qty *price){
  660.                     traded();
  661.                     break;
  662.                 }
  663.             case 6:
  664.                 goodType = 5;
  665.                 determineCountry();
  666.                 inv = toolsInv;
  667.                 price = priceArrays[goodType];
  668.                 quantity();
  669.                 if (balance < qty *price){
  670.                     lack();
  671.                     break;
  672.                 }
  673.                 else if (balance >= qty *price){
  674.                     traded();
  675.                     break;
  676.                 }
  677.             case 7:
  678.                 goodType = 6;
  679.                 determineCountry();
  680.                 inv = spiceInv;
  681.                 price = priceArrays[goodType];
  682.                 quantity();
  683.                 if (balance < qty *price){
  684.                     lack();
  685.                     break;
  686.                 }
  687.                 else if (balance >= qty *price){
  688.                     traded();
  689.                     break;
  690.                 }
  691.             //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
  692.             case 8:
  693.                 goodType = 7;
  694.                 determineCountry();
  695.                 inv = ironInv;
  696.                 price = priceArrays[goodType];
  697.                 quantity();
  698.                 if (balance < qty *price){
  699.                     lack();
  700.                     break;
  701.                 }
  702.                 else if (balance >= qty *price){
  703.                     traded();
  704.                     break;
  705.                 }
  706.             case 9:
  707.                 goodType = 8;
  708.                 determineCountry();
  709.                 inv = flourInv;
  710.                 price = priceArrays[goodType];
  711.                 quantity();
  712.                 if (balance < qty *price){
  713.                     lack();
  714.                     break;
  715.                 }
  716.                 else if (balance >= qty *price){
  717.                     traded();
  718.                     break;
  719.                 }
  720.             case 10:
  721.                 goodType = 9;
  722.                 determineCountry();
  723.                 inv = dyeInv;
  724.                 price = priceArrays[goodType];
  725.                 quantity();
  726.                 if (balance < qty *price){
  727.                     lack();
  728.                     break;
  729.                 }
  730.                 else if (balance >= qty *price){
  731.                     traded();
  732.                     break;
  733.                 }
  734.             case 11:
  735.                 goodType = 10;
  736.                 determineCountry();
  737.                 inv = leatherInv;
  738.                 price = priceArrays[goodType];
  739.                 quantity();
  740.                 if (balance < qty *price){
  741.                     lack();
  742.                     break;
  743.                 }
  744.                 else if (balance >= qty *price){
  745.                     traded();
  746.                     break;
  747.                 }
  748.             case 12:
  749.                 goodType = 11;
  750.                 determineCountry();
  751.                 inv = furInv;
  752.                 price = priceArrays[goodType];
  753.                 quantity();
  754.                 if (balance < qty *price){
  755.                     lack();
  756.                     break;
  757.                 }
  758.                 else if (balance >= qty *price){
  759.                     traded();
  760.                     break;
  761.                 }
  762.             case 13:
  763.                 goodType = 12;
  764.                 determineCountry();
  765.                 inv = beerInv;
  766.                 price = priceArrays[goodType];
  767.                 quantity();
  768.                 if (balance < qty *price){
  769.                     lack();
  770.                     break;
  771.                 }
  772.                 else if (balance >= qty *price){
  773.                     traded();
  774.                     break;
  775.                 }
  776.             case 14:
  777.                 goodType = 13;
  778.                 determineCountry();
  779.                 inv = saltInv;
  780.                 price = priceArrays[goodType];
  781.                 quantity();
  782.                 if (balance < qty *price){
  783.                     lack();
  784.                     break;
  785.                 }
  786.                 else if (balance >= qty *price){
  787.                     traded();
  788.                     break;
  789.                 }
  790.             case 15:
  791.                 goodType = 14;
  792.                 determineCountry();
  793.                 inv = wineInv;
  794.                 price = priceArrays[goodType];
  795.                 quantity();
  796.                 if (balance < qty *price){
  797.                     lack();
  798.                     break;
  799.                 }
  800.                 else if (balance >= qty *price){
  801.                     traded();
  802.                     break;
  803.                 }
  804.             case 16:
  805.                 check();
  806.                 break;
  807.             case 17:
  808.                 notes();
  809.                 break;
  810.             case 18:
  811.                 trade();
  812.                 break;
  813.    
  814.             default:
  815.                 cout << setw(60);
  816.                 cout << "That's an invalid option. Please try again.";
  817.                 cout << endl;
  818.         }
  819.     } while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "5"|| input != "6"|| input != "7"|| input != "8"|| input != "9"|| input != "10"|| input != "11"|| input != "12"|| input != "13"|| input != "14"|| input != "15"|| input != "16"|| input != "17"|| input != "18");
  820.  
  821. }
  822.  
  823. //traded function
  824. void traded(void){
  825.     cout << setprecision(2) << fixed;
  826.     if (mem3 == 0){ //buy
  827.         balance -= qty * price;
  828.         balance_balance();
  829.         cout << endl;
  830.         cout << setw(40);
  831.         cout << "You bought " << tradeGoods[goodType] << "for Eur " << qty * price << ".";
  832.         cout << endl;
  833.         if (goodType==0) potInv+=qty;
  834.         else if (goodType==1) oilInv+=qty;
  835.         else if (goodType==2) fishInv+=qty;
  836.         else if (goodType==3) woolInv+=qty;
  837.         else if (goodType==4) velvetInv+=qty;
  838.         else if (goodType==5) toolsInv+=qty;
  839.         else if (goodType==6) spiceInv+=qty;
  840.         else if (goodType==7) ironInv+=qty;
  841.         else if (goodType==8) flourInv+=qty;
  842.         else if (goodType==9) dyeInv+=qty;
  843.         else if (goodType==10) leatherInv+=qty;
  844.         else if (goodType==11) furInv+=qty;
  845.         else if (goodType==12) beerInv+=qty;
  846.         else if (goodType==13) saltInv+=qty;
  847.         else if (goodType==14) wineInv+=qty;
  848.     }
  849.     else if (mem3 == 1){ //sell
  850.         balance += qty * price;
  851.         balance_balance();
  852.         cout << endl;
  853.         cout << setw(40);
  854.         cout << "You sold " << tradeGoods[goodType] << " for Eur " << qty * price << ".";
  855.         cout << endl;
  856.         if (goodType==0) potInv-=qty;
  857.         else if (goodType==1) oilInv-=qty;
  858.         else if (goodType==2) fishInv-=qty;
  859.         else if (goodType==3) woolInv-=qty;
  860.         else if (goodType==4) velvetInv-=qty;
  861.         else if (goodType==5) toolsInv-=qty;
  862.         else if (goodType==6) spiceInv-=qty;
  863.         else if (goodType==7) ironInv-=qty;
  864.         else if (goodType==8) flourInv-=qty;
  865.         else if (goodType==9) dyeInv-=qty;
  866.         else if (goodType==10) leatherInv-=qty;
  867.         else if (goodType==11) furInv-=qty;
  868.         else if (goodType==12) beerInv-=qty;
  869.         else if (goodType==13) saltInv-=qty;
  870.         else if (goodType==14) wineInv-=qty;
  871.         cout << endl;
  872.  
  873.     }
  874.     turn++;
  875.     bankMoney2 = 0;
  876.     compoundBank();
  877.     userDebt();
  878.     memDp2 = 0;
  879.     checkers=0;
  880.     if(turn%6==0)
  881.     {
  882.     potInvSwede += 10;
  883.     potInvPol += 10;
  884.     potInvRus += 10;
  885.     potInvCri += 10;
  886.     potInvSau += 10;
  887.     potInvUkr += 10;
  888.     potInvChi += 10;
  889.     oilInvSwede += 5;
  890.     oilInvPol += 5;
  891.     oilInvRus += 5;
  892.     oilInvCri += 5;
  893.     oilInvSau += 5;
  894.     oilInvUkr += 5;
  895.     oilInvChi += 5;
  896.     fishInvSwede += 15;
  897.     fishInvPol += 15;
  898.     fishInvRus += 15;
  899.     fishInvCri += 15;
  900.     fishInvSau += 15;
  901.     fishInvUkr += 15;
  902.     fishInvChi += 15;
  903.     woolInvSwede += 8;
  904.     woolInvPol += 8;
  905.     woolInvRus += 8;
  906.     woolInvCri += 8;
  907.     woolInvSau += 8;
  908.     woolInvUkr += 8;
  909.     woolInvChi += 8;
  910.     velvetInvSwede += 3;
  911.     velvetInvPol += 3;
  912.     velvetInvRus += 3;
  913.     velvetInvCri += 3;
  914.     velvetInvSau += 3;
  915.     velvetInvUkr += 3;
  916.     velvetInvChi += 3;
  917.     toolsInvSwede += 8;
  918.     toolsInvPol += 8;
  919.     toolsInvRus += 8;
  920.     toolsInvCri += 8;
  921.     toolsInvSau += 8;
  922.     toolsInvUkr += 8;
  923.     toolsInvChi += 8;
  924.     spiceInvSwede += 5;
  925.     spiceInvPol += 5;
  926.     spiceInvRus += 5;
  927.     spiceInvCri += 5;
  928.     spiceInvSau += 5;
  929.     spiceInvUkr += 5;
  930.     spiceInvChi += 5;
  931.     ironInvSwede += 8;
  932.     ironInvPol += 8;
  933.     ironInvRus += 8;
  934.     ironInvCri += 8;
  935.     ironInvSau += 8;
  936.     ironInvUkr += 8;
  937.     ironInvChi += 8;
  938.     flourInvSwede += 15;
  939.     flourInvPol += 15;
  940.     flourInvRus += 15;
  941.     flourInvCri += 15;
  942.     flourInvSau += 15;
  943.     flourInvUkr += 15;
  944.     flourInvChi += 15;
  945.     dyeInvSwede += 8;
  946.     dyeInvPol += 8;
  947.     dyeInvRus += 8;
  948.     dyeInvCri += 8;
  949.     dyeInvSau += 8;
  950.     dyeInvUkr += 8;
  951.     dyeInvChi += 8;
  952.     leatherInvSwede += 8;
  953.     leatherInvPol += 8;
  954.     leatherInvRus += 8;
  955.     leatherInvCri += 8;
  956.     leatherInvSau += 8;
  957.     leatherInvUkr += 8;
  958.     leatherInvChi += 8;
  959.     furInvSwede += 8;
  960.     furInvPol += 8;
  961.     furInvRus += 8;
  962.     furInvCri += 8;
  963.     furInvSau += 8;
  964.     furInvUkr += 8;
  965.     furInvChi += 8;
  966.     beerInvSwede += 8;
  967.     beerInvPol += 8;
  968.     beerInvRus += 8;
  969.     beerInvCri += 8;
  970.     beerInvSau += 8;
  971.     beerInvUkr += 8;
  972.     beerInvChi += 8;
  973.     saltInvSwede +=8;
  974.     saltInvPol += 8;
  975.     saltInvRus += 8;
  976.     saltInvCri += 8;
  977.     saltInvSau += 8;
  978.     saltInvUkr += 8;
  979.     saltInvChi += 8;
  980.     wineInvSwede += 8;
  981.     wineInvPol += 8;
  982.     wineInvRus += 8;
  983.     wineInvCri += 8;
  984.     wineInvSau += 8;
  985.     wineInvUkr += 8;
  986.     wineInvChi += 8;
  987.     }
  988.  
  989.     system("pause");
  990.     loc();
  991. }
  992.  
  993. //quantity function
  994. void quantity(void){
  995.     mem = 4;
  996.     if (mem3 == 0){
  997.         //Ask
  998.         cout << setw(30);
  999.         cout << "How many " << tradeGoods[goodType] << "do you want to buy? ";
  1000.         cin >> qty;
  1001.         if (qty < 0){
  1002.             quantity();
  1003.         }
  1004.         else if (qty == 0){
  1005.             cout << endl;
  1006.             cout << "You bought nothing . . . ";
  1007.             cout << endl;
  1008.             system("pause");
  1009.             buy();
  1010.         }
  1011.         countryInv();
  1012.     }
  1013.     else if (mem3 == 1){
  1014.         cout << setw(30);
  1015.         cout << "How many " << tradeGoods[goodType] << "do you want to sell? ";
  1016.         cin >> qty;
  1017.         if (qty < 0){
  1018.             quantity();
  1019.         }
  1020.         else if (qty == 0){
  1021.             cout << endl;
  1022.             cout << "You sold nothing . . . ";
  1023.             cout << endl;
  1024.             system("pause");
  1025.             sell();
  1026.         }
  1027.         countryInv();
  1028.     }
  1029.     else quantity();
  1030. }
  1031.  
  1032. //lacking function
  1033. void lack(void){
  1034.     if (mem3 == 0){
  1035.         cout << endl;
  1036.         cout << endl;
  1037.         cout << "You have insufficient balance ... ";
  1038.         cout << endl;
  1039.         cout << endl;
  1040.         system("pause");
  1041.         buy();
  1042.     }
  1043.     else if (mem3 == 1){
  1044.         cout << endl;
  1045.         cout << endl;
  1046.         cout << "You don't have " << qty << " of " << tradeGoods[goodType];
  1047.         cout << endl;
  1048.         cout << endl;
  1049.         system("pause");
  1050.         sell();
  1051.     }
  1052. }
  1053.  
  1054. //sell function
  1055. void sell(void){
  1056.     string input;
  1057.     int x;
  1058.     mem = 3;
  1059.     mem2 = 3;
  1060.     mem3 = 1;
  1061.     if (land == 0){
  1062.         cout << endl;
  1063.         cout << setw(48);
  1064.         cout << "You are trading with Sweden . . . ";
  1065.         cout << endl;
  1066.     }
  1067.     else if (land == 1){
  1068.         cout << endl;
  1069.         cout << setw(48);
  1070.         cout << "You are trading with Poland . . . ";
  1071.         cout << endl;
  1072.     }
  1073.       else if (land == 2){
  1074.         cout << endl;
  1075.         cout << setw(48);
  1076.         cout << "You are trading with Russia . . . ";
  1077.         cout << endl;
  1078.     }
  1079.    else if (land == 3){
  1080.         cout << endl;
  1081.         cout << setw(48);
  1082.         cout << "You are trading with Crimea . . . ";
  1083.         cout << endl;
  1084.     }
  1085.     else if (land == 4){
  1086.         cout << endl;
  1087.         cout << setw(54);
  1088.         cout << "You are trading with Saudi Arabia . . . ";
  1089.         cout << endl;
  1090.     }
  1091.     else if (land == 5){
  1092.         cout << endl;
  1093.         cout << setw(49);
  1094.         cout << "You are trading with Ukraine . . . ";
  1095.         cout << endl;
  1096.     }
  1097.     else if (land == 6){
  1098.         cout << endl;
  1099.         cout << setw(47);
  1100.         cout << "You are trading with China . . . ";
  1101.         cout << endl;
  1102.     }
  1103.     country = "None";
  1104.     balance_balance();
  1105.     goods();
  1106.     cout << setw(40);
  1107.     cout << "What do you want to sell? ";
  1108.     cout << endl;
  1109.     do {
  1110.         cout << setw(27);
  1111.         cout << "Enter Input: ";
  1112.         cin >> input;
  1113.         stringstream(input) >> x;
  1114.         switch (x){
  1115.            case 1:
  1116.                 goodType = 0;
  1117.                 determineCountry();
  1118.                 inv = potInv;
  1119.                 price = priceArrays[goodType];
  1120.                 quantity();
  1121.                 if (inv < qty){
  1122.                     lack();
  1123.                     break;
  1124.                 }
  1125.                 else if (inv >= qty){
  1126.                     traded();
  1127.                     break;
  1128.                 }
  1129.             case 2:
  1130.                 goodType = 1;
  1131.                 determineCountry();
  1132.                 inv = oilInv;
  1133.                 price = priceArrays[goodType];
  1134.                 quantity();
  1135.                 if (inv < qty){
  1136.                     lack();
  1137.                     break;
  1138.                 }
  1139.                 else if (inv >= qty){
  1140.                     traded();
  1141.                     break;
  1142.                 }
  1143.             case 3:
  1144.                 goodType = 2;
  1145.                 determineCountry();
  1146.                 inv = fishInv;
  1147.                 price = priceArrays[goodType];
  1148.                 quantity();
  1149.                 if (inv < qty){
  1150.                     lack();
  1151.                     break;
  1152.                 }
  1153.                 else if (inv >= qty){
  1154.                     traded();
  1155.                     break;
  1156.                 }
  1157.             case 4:
  1158.                 goodType = 3;
  1159.                 determineCountry();
  1160.                 inv = woolInv;
  1161.                 price = priceArrays[goodType];
  1162.                 quantity();
  1163.                 if (inv < qty){
  1164.                     lack();
  1165.                     break;
  1166.                 }
  1167.                 else if (inv >= qty){
  1168.                     traded();
  1169.                     break;
  1170.                 }
  1171.             case 5:
  1172.                 goodType = 4;
  1173.                 determineCountry();
  1174.                 inv = velvetInv;
  1175.                 price = priceArrays[goodType];
  1176.                 quantity();
  1177.                 if (inv < qty){
  1178.                     lack();
  1179.                     break;
  1180.                 }
  1181.                 else if (inv >= qty){
  1182.                     traded();
  1183.                     break;
  1184.                 }
  1185.             case 6:
  1186.                 goodType = 5;
  1187.                 determineCountry();
  1188.                 inv = toolsInv;
  1189.                 price = priceArrays[goodType];
  1190.                 quantity();
  1191.                 if (inv < qty){
  1192.                     lack();
  1193.                     break;
  1194.                 }
  1195.                 else if (inv >= qty){
  1196.                     traded();
  1197.                     break;
  1198.                 }
  1199.             case 7:
  1200.                 goodType = 6;
  1201.                 determineCountry();
  1202.                 inv = spiceInv;
  1203.                 price = priceArrays[goodType];
  1204.                 quantity();
  1205.                 if (inv < qty){
  1206.                     lack();
  1207.                     break;
  1208.                 }
  1209.                 else if (inv >= qty){
  1210.                     traded();
  1211.                     break;
  1212.                 }
  1213.             case 8:
  1214.                 goodType = 7;
  1215.                 determineCountry();
  1216.                 inv = ironInv;
  1217.                 price = priceArrays[goodType];
  1218.                 quantity();
  1219.                 if (inv < qty){
  1220.                     lack();
  1221.                     break;
  1222.                 }
  1223.                 else if (inv >= qty){
  1224.                     traded();
  1225.                     break;
  1226.                 }
  1227.             case 9:
  1228.                 goodType = 8;
  1229.                 determineCountry();
  1230.                 inv = flourInv;
  1231.                 price = priceArrays[goodType];
  1232.                 quantity();
  1233.                 if (inv < qty){
  1234.                     lack();
  1235.                     break;
  1236.                 }
  1237.                 else if (inv >= qty){
  1238.                     traded();
  1239.                     break;
  1240.                 }
  1241.             case 10:
  1242.                 goodType = 9;
  1243.                 determineCountry();
  1244.                 inv = dyeInv;
  1245.                 price = priceArrays[goodType];
  1246.                 quantity();
  1247.                 if (inv < qty){
  1248.                     lack();
  1249.                     break;
  1250.                 }
  1251.                 else if (inv >= qty){
  1252.                     traded();
  1253.                     break;
  1254.                 }
  1255.             case 11:
  1256.                 goodType = 10;
  1257.                 determineCountry();
  1258.                 inv = leatherInv;
  1259.                 price = priceArrays[goodType];
  1260.                 quantity();
  1261.                 if (inv < qty){
  1262.                     lack();
  1263.                     break;
  1264.                 }
  1265.                 else if (inv >= qty){
  1266.                     traded();
  1267.                     break;
  1268.                 }
  1269.             case 12:
  1270.                 goodType = 11;
  1271.                 determineCountry();
  1272.                 inv = furInv;
  1273.                 price = priceArrays[goodType];
  1274.                 quantity();
  1275.                 if (inv < qty){
  1276.                     lack();
  1277.                     break;
  1278.                 }
  1279.                 else if (inv >= qty){
  1280.                     traded();
  1281.                     break;
  1282.                 }
  1283.             case 13:
  1284.                 goodType = 12;
  1285.                 determineCountry();
  1286.                 inv = beerInv;
  1287.                 price = priceArrays[goodType];
  1288.                 quantity();
  1289.                 if (inv < qty){
  1290.                     lack();
  1291.                     break;
  1292.                 }
  1293.                 else if (inv >= qty){
  1294.                     traded();
  1295.                     break;
  1296.                 }
  1297.             case 14:
  1298.                 goodType = 13;
  1299.                 determineCountry();
  1300.                 inv = saltInv;
  1301.                 price = priceArrays[goodType];
  1302.                 quantity();
  1303.                 if (inv < qty){
  1304.                     lack();
  1305.                     break;
  1306.                 }
  1307.                 else if (inv >= qty){
  1308.                     traded();
  1309.                     break;
  1310.                 }
  1311.             case 15:
  1312.                 goodType = 14;
  1313.                 determineCountry();
  1314.                 inv = wineInv;
  1315.                 price = priceArrays[goodType];
  1316.                 quantity();
  1317.                 if (inv < qty){
  1318.                     lack();
  1319.                     break;
  1320.                 }
  1321.                 else if (inv >= qty){
  1322.                     traded();
  1323.                     break;
  1324.                 }
  1325.             case 16:
  1326.                 check();
  1327.                 break;
  1328.             case 17:
  1329.                 notes();
  1330.                 break;
  1331.             case 18:
  1332.                 trade();
  1333.                 break;
  1334.             default:
  1335.                 cout << setw(60);
  1336.                 cout << "That's an invalid option. Please try again.";
  1337.                 cout << endl;
  1338.         }
  1339.     }while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "5"|| input != "6"|| input != "7");
  1340. }
  1341. //notes function
  1342. void notes(void){
  1343.     if (country == "Sweden"){
  1344.         cout << endl;
  1345.         cout << "Sweden's exports and imports are well-met . . . ";
  1346.         cout << endl;
  1347.         //For checking . . .
  1348.         cout << "Sweden's Inventory . . . ";
  1349.         cout << endl;
  1350.         cout << "Pottery: " << potInvSwede;
  1351.         cout << endl;
  1352.         cout << "Oil: " << oilInvSwede;
  1353.         cout << endl;
  1354.         cout << "Fish: " << fishInvSwede;
  1355.         cout << endl;
  1356.         cout << "Wool Cloth:" << woolInvSwede;
  1357.         cout << endl;
  1358.         cout << "Velvet: " << velvetInvSwede;
  1359.         cout << endl;
  1360.         cout << "Tools: " << toolsInvSwede;
  1361.         cout << endl;
  1362.         cout << "Spice: " << spiceInvSwede;
  1363.         cout << endl;
  1364.         cout << "Iron: " << ironInvSwede;
  1365.         cout << endl;
  1366.         cout << "Flour: " << flourInvSwede;
  1367.         cout << endl;
  1368.         cout << "Dyes: " << dyeInvSwede;
  1369.         cout << endl;
  1370.         cout << "Leatherworks: " << leatherInvSwede;
  1371.         cout << endl;
  1372.         cout << "Fur: " << furInvSwede;
  1373.         cout << endl;
  1374.         cout << "Beer: " << beerInvSwede;
  1375.         cout << endl;
  1376.         cout << "Salt: " << saltInvSwede;
  1377.         cout << endl;
  1378.         cout << "Wine: " << wineInvSwede;
  1379.         cout << endl;
  1380.     }
  1381.     else if (country == "Poland"){
  1382.         cout << endl;
  1383.         cout << "Poland's Exports and Imports . . . ";
  1384.         cout << endl;
  1385.         cout << "Exports: Oil, Beer, Flour, Tools";
  1386.         cout << endl;
  1387.         cout << "Imports: Velvet, Iron, Spice, Pottery";
  1388.         cout << endl;
  1389.         // Checking . . .
  1390.         cout << "Poland's Inventory . . . ";
  1391.         cout << endl;
  1392.         cout << "Pottery: " << potInvPol;
  1393.         cout << endl;
  1394.         cout << "Oil: " << oilInvPol;
  1395.         cout << endl;
  1396.         cout << "Fish: " << fishInvPol;
  1397.         cout << endl;
  1398.         cout << "Wool Cloth:" << woolInvPol;
  1399.         cout << endl;
  1400.         cout << "Velvet: " << velvetInvPol;
  1401.         cout << endl;
  1402.         cout << "Tools: " << toolsInvPol;
  1403.         cout << endl;
  1404.         cout << "Spice: " << spiceInvPol;
  1405.         cout << endl;
  1406.         cout << "Iron: " << ironInvPol;
  1407.         cout << endl;
  1408.         cout << "Flour: " << flourInvPol;
  1409.         cout << endl;
  1410.         cout << "Dyes: " << dyeInvPol;
  1411.         cout << endl;
  1412.         cout << "Leatherworks: " << leatherInvPol;
  1413.         cout << endl;
  1414.         cout << "Fur: " << furInvPol;
  1415.         cout << endl;
  1416.         cout << "Beer: " << beerInvPol;
  1417.         cout << endl;
  1418.         cout << "Salt: " << saltInvPol;
  1419.         cout << endl;
  1420.         cout << "Wine: " << wineInvPol;
  1421.         cout << endl;
  1422.     }
  1423.     else if (country == "Russia"){
  1424.         cout << endl;
  1425.         cout << "Russia's Exports and Imports . . . ";
  1426.         cout << endl;
  1427.         cout << "Exports: Furs, Dyes, Spice, Wool";
  1428.         cout << endl;
  1429.         cout << "Imports: Oil, Fish, Salt, Velvet, Flour, Pottery, Beer, Tools, Iron, Leatherworks";
  1430.         cout << endl;
  1431.         // Checking . . .
  1432.         cout << "Russia's Inventory . . . ";
  1433.         cout << endl;
  1434.         cout << "Pottery: " << potInvRus;
  1435.         cout << endl;
  1436.         cout << "Oil: " << oilInvRus;
  1437.         cout << endl;
  1438.         cout << "Fish: " << fishInvRus;
  1439.         cout << endl;
  1440.         cout << "Wool Cloth:" << woolInvRus;
  1441.         cout << endl;
  1442.         cout << "Velvet: " << velvetInvRus;
  1443.         cout << endl;
  1444.         cout << "Tools: " << toolsInvRus;
  1445.         cout << endl;
  1446.         cout << "Spice: " << spiceInvRus;
  1447.         cout << endl;
  1448.         cout << "Iron: " << ironInvRus;
  1449.         cout << endl;
  1450.         cout << "Flour: " << flourInvRus;
  1451.         cout << endl;
  1452.         cout << "Dyes: " << dyeInvRus;
  1453.         cout << endl;
  1454.         cout << "Leatherworks: " << leatherInvRus;
  1455.         cout << endl;
  1456.         cout << "Fur: " << furInvRus;
  1457.         cout << endl;
  1458.         cout << "Beer: " << beerInvRus;
  1459.         cout << endl;
  1460.         cout << "Salt: " << saltInvRus;
  1461.         cout << endl;
  1462.         cout << "Wine: " << wineInvRus;
  1463.         cout << endl;
  1464.     }
  1465.     else if (country == "Crimea"){
  1466.         cout << endl;
  1467.         cout << "Crimea's Exports and Imports . . . ";
  1468.         cout << endl;
  1469.         cout << "Exports: Leatherworks, Salt, Wine";
  1470.         cout << endl;
  1471.         cout << "Imports: Iron, Oil, Beer";
  1472.         cout << endl;
  1473.         // Checking . . .
  1474.         cout << "Crimea's Inventory . . . ";
  1475.         cout << endl;
  1476.         cout << "Pottery: " << potInvCri;
  1477.         cout << endl;
  1478.         cout << "Oil: " << oilInvCri;
  1479.         cout << endl;
  1480.         cout << "Fish: " << fishInvCri;
  1481.         cout << endl;
  1482.         cout << "Wool Cloth:" << woolInvCri;
  1483.         cout << endl;
  1484.         cout << "Velvet: " << velvetInvCri;
  1485.         cout << endl;
  1486.         cout << "Tools: " << toolsInvCri;
  1487.         cout << endl;
  1488.         cout << "Spice: " << spiceInvCri;
  1489.         cout << endl;
  1490.         cout << "Iron: " << ironInvCri;
  1491.         cout << endl;
  1492.         cout << "Flour: " << flourInvCri;
  1493.         cout << endl;
  1494.         cout << "Dyes: " << dyeInvCri;
  1495.         cout << endl;
  1496.         cout << "Leatherworks: " << leatherInvCri;
  1497.         cout << endl;
  1498.         cout << "Fur: " << furInvCri;
  1499.         cout << endl;
  1500.         cout << "Beer: " << beerInvCri;
  1501.         cout << endl;
  1502.         cout << "Salt: " << saltInvCri;
  1503.         cout << endl;
  1504.         cout << "Wine: " << wineInvCri;
  1505.         cout << endl;
  1506.     }
  1507.     else if (country == "Saudi"){
  1508.         cout << endl;
  1509.         cout << "Saudi Arabia's Exports and Imports . . . ";
  1510.         cout << endl;
  1511.         cout << "Exports: Salt, Pottery, Velvet";
  1512.         cout << endl;
  1513.         cout << "Imports: Flour, Beer, Fish";
  1514.         cout << endl;
  1515.         // Checking . . .
  1516.         cout << "Pottery: " << potInvSau;
  1517.         cout << endl;
  1518.         cout << "Oil: " << oilInvSau;
  1519.         cout << endl;
  1520.         cout << "Fish: " << fishInvSau;
  1521.         cout << endl;
  1522.         cout << "Wool Cloth:" << woolInvSau;
  1523.         cout << endl;
  1524.         cout << "Velvet: " << velvetInvSau;
  1525.         cout << endl;
  1526.         cout << "Tools: " << toolsInvSau;
  1527.         cout << endl;
  1528.         cout << "Spice: " << spiceInvSau;
  1529.         cout << endl;
  1530.         cout << "Iron: " << ironInvSau;
  1531.         cout << endl;
  1532.         cout << "Flour: " << flourInvSau;
  1533.         cout << endl;
  1534.         cout << "Dyes: " << dyeInvSau;
  1535.         cout << endl;
  1536.         cout << "Leatherworks: " << leatherInvSau;
  1537.         cout << endl;
  1538.         cout << "Fur: " << furInvSau;
  1539.         cout << endl;
  1540.         cout << "Beer: " << beerInvSau;
  1541.         cout << endl;
  1542.         cout << "Salt: " << saltInvSau;
  1543.         cout << endl;
  1544.         cout << "Wine: " << wineInvSau;
  1545.         cout << endl;
  1546.     }
  1547.     else if (country == "Ukraine"){
  1548.         cout << endl;
  1549.         cout << "Ukraine's exports and imports are slightly well-met . . . ";
  1550.         cout << endl;
  1551.         //For checking . . .
  1552.         cout << "Ukraine's Inventory . . . ";
  1553.         cout << endl;
  1554.         cout << "Pottery: " << potInvUkr;
  1555.         cout << endl;
  1556.         cout << "Oil: " << oilInvUkr;
  1557.         cout << endl;
  1558.         cout << "Fish: " << fishInvUkr;
  1559.         cout << endl;
  1560.         cout << "Wool Cloth:" << woolInvUkr;
  1561.         cout << endl;
  1562.         cout << "Velvet: " << velvetInvUkr;
  1563.         cout << endl;
  1564.         cout << "Tools: " << toolsInvUkr;
  1565.         cout << endl;
  1566.         cout << "Spice: " << spiceInvUkr;
  1567.         cout << endl;
  1568.         cout << "Iron: " << ironInvUkr;
  1569.         cout << endl;
  1570.         cout << "Flour: " << flourInvUkr;
  1571.         cout << endl;
  1572.         cout << "Dyes: " << dyeInvUkr;
  1573.         cout << endl;
  1574.         cout << "Leatherworks: " << leatherInvUkr;
  1575.         cout << endl;
  1576.         cout << "Fur: " << furInvUkr;
  1577.         cout << endl;
  1578.         cout << "Beer: " << beerInvUkr;
  1579.         cout << endl;
  1580.         cout << "Salt: " << saltInvUkr;
  1581.         cout << endl;
  1582.         cout << "Wine: " << wineInvUkr;
  1583.         cout << endl;
  1584.     }
  1585.     else if (country == "China"){
  1586.         cout << endl;
  1587.         cout << "China's exports and imports are well-met . . . ";
  1588.         cout << endl;
  1589.         //For checking . . .
  1590.         cout << "China's Inventory . . . ";
  1591.         cout << endl;
  1592.         cout << "Pottery: " << potInvChi;
  1593.         cout << endl;
  1594.         cout << "Oil: " << oilInvChi;
  1595.         cout << endl;
  1596.         cout << "Fish: " << fishInvChi;
  1597.         cout << endl;
  1598.         cout << "Wool Cloth:" << woolInvChi;
  1599.         cout << endl;
  1600.         cout << "Velvet: " << velvetInvChi;
  1601.         cout << endl;
  1602.         cout << "Tools: " << toolsInvChi;
  1603.         cout << endl;
  1604.         cout << "Spice: " << spiceInvChi;
  1605.         cout << endl;
  1606.         cout << "Iron: " << ironInvChi;
  1607.         cout << endl;
  1608.         cout << "Flour: " << flourInvChi;
  1609.         cout << endl;
  1610.         cout << "Dyes: " << dyeInvChi;
  1611.         cout << endl;
  1612.         cout << "Leatherworks: " << leatherInvChi;
  1613.         cout << endl;
  1614.         cout << "Fur: " << furInvChi;
  1615.         cout << endl;
  1616.         cout << "Beer: " << beerInvChi;
  1617.         cout << endl;
  1618.         cout << "Salt: " << saltInvChi;
  1619.         cout << endl;
  1620.         cout << "Wine: " << wineInvChi;
  1621.         cout << endl;
  1622.     }
  1623.  
  1624.    
  1625.     else if (country == "None"){
  1626.         cout << "Input country notes: ";
  1627.         cin >> country;
  1628.         notes();
  1629.     }
  1630.     else{
  1631.         cout << "Input country notes: ";
  1632.                 cin >> country;
  1633.                 notes();
  1634.     }
  1635.     system("pause");
  1636.     if (mem2 == 1) trade();
  1637.     else if (mem2 == 2) buy();
  1638.     else if (mem2 == 3) sell();
  1639.     else if (mem2 == 4) quantity();
  1640.     else if (mem2 == 5) todo2();
  1641. }
  1642.  
  1643. //balance function
  1644. void balance_balance(void){
  1645.     cout << endl;
  1646.     cout << setw(27);
  1647.     cout << setprecision(2) << fixed;
  1648.     cout << "Balance: Eur " << balance;
  1649.     cout << endl;
  1650. }
  1651.  
  1652. //todo function
  1653. void todo(void){
  1654.     if (land == 0){
  1655.         cout << endl;
  1656.         cout << "             =============================================================================";
  1657.         cout << endl;
  1658.         cout << setw(52);
  1659.         cout << "You are now trading with Sweden . . . ";
  1660.         cout << endl;
  1661.         cout << "             =============================================================================";
  1662.         cout << endl;
  1663.         todo2();
  1664.     }
  1665.     else if (land == 1){
  1666.         cout << endl;
  1667.         cout << "             =============================================================================";
  1668.         cout << endl;
  1669.         cout << setw(52);
  1670.         cout << "You are now trading with Poland . . . ";
  1671.         cout << endl;
  1672.         cout << "             =============================================================================";
  1673.         cout << endl;
  1674.         todo2();
  1675.     }
  1676.       else if (land == 2){
  1677.         cout << endl;
  1678.         cout << "             =============================================================================";
  1679.         cout << endl;
  1680.         cout << setw(52);
  1681.         cout << "You are now trading with Russia . . . ";
  1682.         cout << endl;
  1683.         cout << "             =============================================================================";
  1684.         cout << endl;
  1685.         todo2();
  1686.     }
  1687.     else if (land == 3){
  1688.         cout << endl;
  1689.         cout << "             =============================================================================";
  1690.         cout << endl;
  1691.         cout << setw(52);
  1692.         cout << "You are now trading with Crimea . . . ";
  1693.         cout << endl;
  1694.         cout << "             =============================================================================";
  1695.         cout << endl;
  1696.         todo2();
  1697.     }
  1698.     else if (land == 4){
  1699.         cout << endl;
  1700.         cout << "             =============================================================================";
  1701.         cout << endl;
  1702.         cout << setw(58);
  1703.         cout << "You are now trading with Saudi Arabia . . . ";
  1704.         cout << endl;
  1705.         cout << "             =============================================================================";
  1706.         cout << endl;
  1707.         todo2();
  1708.     }
  1709.     else if (land == 5){
  1710.         cout << endl;
  1711.         cout << "             =============================================================================";
  1712.         cout << endl;
  1713.         cout << setw(53);
  1714.         cout << "You are now trading with Ukraine . . . ";
  1715.         cout << endl;
  1716.         cout << "             =============================================================================";
  1717.         cout << endl;
  1718.         todo2();
  1719.     }
  1720.     else if (land == 6){
  1721.         cout << endl;
  1722.         cout << "             =============================================================================";
  1723.         cout << endl;
  1724.         cout << setw(51);
  1725.         cout << "You are now trading with China . . . ";
  1726.         cout << endl;
  1727.         cout << "             =============================================================================";
  1728.         cout << endl;
  1729.         todo2();
  1730.     }
  1731.  
  1732. }
  1733.  
  1734. //todo2 function
  1735. void todo2(void){
  1736.     int x;
  1737.     country = "None";
  1738.     mem = 4;
  1739.     mem2 = 5;
  1740.     cout << endl;
  1741.     cout << setw(18);
  1742.     cout << "[1] " << setw(17) << "Buy";
  1743.     cout << endl;
  1744.     cout << setw(18);
  1745.     cout << "[2] " << setw(17) << "Sell";
  1746.     cout << endl;
  1747.     cout << setw(18);
  1748.     cout << "[3] " << setw(17) << "Check inventory";
  1749.     cout << endl;
  1750.     cout << setw(18);
  1751.     cout << "[4] " << setw(17) << "Check notes";
  1752.     cout << endl;
  1753.     cout << setw(18);
  1754.     cout << "[5] " << setw(17)  << "Return";
  1755.     cout << endl;
  1756.     string input;
  1757.     do {
  1758.         cout << setw(27);
  1759.         cout << "Enter Input: ";
  1760.         cin >> input;
  1761.         stringstream(input) >> x;
  1762.         switch (x){
  1763.             case 1:
  1764.                 buy();
  1765.                 break;
  1766.             case 2:
  1767.                 sell();
  1768.                 break;
  1769.             case 3:
  1770.                 check();
  1771.                 break;
  1772.             case 4:
  1773.                 notes();
  1774.                 break;
  1775.             case 5:
  1776.                 trade();
  1777.                 break;
  1778.             default:
  1779.                 cout << setw(60);
  1780.                 cout << "That's an invalid option. Please try again.";
  1781.                 cout << endl;
  1782.         }
  1783.     } while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "5"|| input != "6"|| input != "7"|| input != "8"|| input != "9"|| input != "10"|| input != "11"|| input != "12"|| input != "13"|| input != "14"|| input != "15"|| input != "16"|| input != "17"|| input != "18"|| input != "19");
  1784.  
  1785.  
  1786. }
  1787. //country inventory
  1788. void countryInv(void){
  1789.     if (land==0){
  1790.         //Buy
  1791.         //Buying pot
  1792.         if (goodType==0 && mem3==0){
  1793.             if (qty>potInvSwede){
  1794.                 cout << setw(62);
  1795.                 cout << "Sweden does not have " << qty << " pottery.";
  1796.                 cout << endl;
  1797.                 cout << endl;
  1798.                 quantity();
  1799.             }
  1800.             else potInvSwede -= qty;
  1801.         }
  1802.         //Buying oil
  1803.         else if (goodType==1 && mem3==0){
  1804.             if (qty>oilInvSwede){
  1805.                 cout << setw(62);
  1806.                 cout << "Sweden does not have " << qty << " oil.";
  1807.                 cout << endl;
  1808.                 cout << endl;
  1809.                 quantity();
  1810.             }
  1811.             else oilInvSwede -= qty;
  1812.         }
  1813.         else if (goodType==2 && mem3==0){
  1814.             if (qty>fishInvSwede){
  1815.                 cout << setw(62);
  1816.                 cout << "Sweden does not have " << qty << " fish.";
  1817.                 cout << endl;
  1818.                 cout << endl;
  1819.                 quantity();
  1820.             }
  1821.             else fishInvSwede -= qty;
  1822.         }
  1823.         else if (goodType==3 && mem3==0){
  1824.             if (qty>woolInvSwede){
  1825.                 cout << setw(62);
  1826.                 cout << "Sweden does not have " << qty << " wool cloth.";
  1827.                 cout << endl;
  1828.                 cout << endl;
  1829.                 quantity();
  1830.             }
  1831.             else woolInvSwede -= qty;
  1832.         }
  1833.         else if (goodType==4 && mem3==0){
  1834.             if (qty>velvetInvSwede){
  1835.                 cout << setw(62);
  1836.                 cout << "Sweden does not have " << qty << " velvet.";
  1837.                 cout << endl;
  1838.                 cout << endl;
  1839.                 quantity();
  1840.             }
  1841.             else velvetInvSwede -= qty;
  1842.         }
  1843.         else if (goodType==5 && mem3==0){
  1844.             if (qty>toolsInvSwede){
  1845.                 cout << setw(62);
  1846.                 cout << "Sweden does not have " << qty << " tools.";
  1847.                 cout << endl;
  1848.                 cout << endl;
  1849.                 quantity();
  1850.             }
  1851.             else toolsInvSwede -= qty;
  1852.         }
  1853.         else if (goodType==6 && mem3==0){
  1854.             if (qty>spiceInvSwede){
  1855.                 cout << setw(62);
  1856.                 cout << "Sweden does not have " << qty << " spice.";
  1857.                 cout << endl;
  1858.                 cout << endl;
  1859.                 quantity();
  1860.             }
  1861.             else spiceInvSwede -= qty;
  1862.         }
  1863.         else if (goodType==7 && mem3==0){
  1864.             if (qty>ironInvSwede){
  1865.                 cout << setw(62);
  1866.                 cout << "Sweden does not have " << qty << " iron.";
  1867.                 cout << endl;
  1868.                 cout << endl;
  1869.                 quantity();
  1870.             }
  1871.             else ironInvSwede -= qty;
  1872.         }
  1873.         else if (goodType==8 && mem3==0){
  1874.             if (qty>flourInvSwede){
  1875.                 cout << setw(62);
  1876.                 cout << "Sweden does not have " << qty << " flour.";
  1877.                 cout << endl;
  1878.                 cout << endl;
  1879.                 quantity();
  1880.             }
  1881.             else flourInvSwede -= qty;
  1882.         }
  1883.         else if (goodType==9 && mem3==0){
  1884.             if (qty>dyeInvSwede){
  1885.                 cout << setw(62);
  1886.                 cout << "Sweden does not have " << qty << " dyes.";
  1887.                 cout << endl;
  1888.                 cout << endl;
  1889.                 quantity();
  1890.             }
  1891.             else dyeInvSwede -= qty;
  1892.         }
  1893.         else if (goodType==10 && mem3==0){
  1894.             if (qty>leatherInvSwede){
  1895.                 cout << setw(62);
  1896.                 cout << "Sweden does not have " << qty << " leatherworks.";
  1897.                 cout << endl;
  1898.                 cout << endl;
  1899.                 quantity();
  1900.             }
  1901.             else leatherInvSwede -= qty;
  1902.         }
  1903.         else if (goodType==11 && mem3==0){
  1904.             if (qty>furInvSwede){
  1905.                 cout << setw(62);
  1906.                 cout << "Sweden does not have " << qty << " fur.";
  1907.                 cout << endl;
  1908.                 cout << endl;
  1909.                 quantity();
  1910.             }
  1911.             else furInvSwede -= qty;
  1912.         }
  1913.         else if (goodType==12 && mem3==0){
  1914.             if (qty>beerInvSwede){
  1915.                 cout << setw(62);
  1916.                 cout << "Sweden does not have " << qty << " beer.";
  1917.                 cout << endl;
  1918.                 cout << endl;
  1919.                 quantity();
  1920.             }
  1921.             else beerInvSwede -= qty;
  1922.         }
  1923.         else if (goodType==13 && mem3==0){
  1924.             if (qty>saltInvSwede){
  1925.                 cout << setw(62);
  1926.                 cout << "Sweden does not have " << qty << " salt.";
  1927.                 cout << endl;
  1928.                 cout << endl;
  1929.                 quantity();
  1930.             }
  1931.             else saltInvSwede -= qty;
  1932.         }
  1933.         else if (goodType==14 && mem3==0){
  1934.             if (qty>wineInvSwede){
  1935.                 cout << setw(62);
  1936.                 cout << "Sweden does not have " << qty << " wine.";
  1937.                 cout << endl;
  1938.                 cout << endl;
  1939.                 quantity();
  1940.             }
  1941.             else wineInvSwede -= qty;
  1942.         }
  1943.        
  1944.         //Sell
  1945.         //Selling pot
  1946.         if (goodType==0 && mem3==1){
  1947.             potInvSwede += qty;
  1948.         }
  1949.         //Selling oil
  1950.         else if (goodType==1 && mem3==1){
  1951.             oilInvSwede += qty;
  1952.         }
  1953.         else if (goodType==2 && mem3==1){
  1954.             fishInvSwede += qty;
  1955.         }
  1956.         else if (goodType==3 && mem3==1){
  1957.             woolInvSwede += qty;
  1958.         }
  1959.         else if (goodType==4 && mem3==1){
  1960.             velvetInvSwede += qty;
  1961.         }
  1962.         else if (goodType==5 && mem3==1){
  1963.             toolsInvSwede += qty;
  1964.         }
  1965.         else if (goodType==6 && mem3==1){
  1966.             spiceInvSwede += qty;
  1967.         }
  1968.         else if (goodType==7 && mem3==1){
  1969.             ironInvSwede += qty;
  1970.         }
  1971.         else if (goodType==8 && mem3==1){
  1972.             flourInvSwede += qty;
  1973.         }
  1974.         else if (goodType==9 && mem3==1){
  1975.             dyeInvSwede += qty;
  1976.         }
  1977.         else if (goodType==10 && mem3==1){
  1978.             leatherInvSwede += qty;
  1979.         }
  1980.         else if (goodType==11 && mem3==1){
  1981.             furInvSwede += qty;
  1982.         }
  1983.         else if (goodType==12 && mem3==1){
  1984.             beerInvSwede += qty;
  1985.         }
  1986.         else if (goodType==13 && mem3==1){
  1987.             saltInvSwede += qty;
  1988.         }
  1989.         else if (goodType==14 && mem3==1){
  1990.             wineInvSwede += qty;
  1991.         }
  1992.     }
  1993.     else if (land==1){
  1994.         //Buy
  1995.         if (goodType==0 && mem3==0){
  1996.             if (qty>potInvPol){
  1997.                 cout << setw(62);
  1998.                 cout << "Poland does not have " << qty << " pottery.";
  1999.                 cout << endl;
  2000.                 cout << endl;
  2001.                 quantity();
  2002.             }
  2003.             else potInvPol -= qty;
  2004.         }
  2005.         else if (goodType==1 && mem3==0){
  2006.             if (qty>oilInvPol){
  2007.                 cout << setw(62);
  2008.                 cout << "Poland does not have " << qty << " oil.";
  2009.                 cout << endl;
  2010.                 cout << endl;
  2011.                 quantity();
  2012.             }
  2013.             else oilInvPol -= qty;
  2014.         }
  2015.         else if (goodType==2 && mem3==0){
  2016.             if (qty>fishInvPol){
  2017.                 cout << setw(62);
  2018.                 cout << "Poland does not have " << qty << " fish.";
  2019.                 cout << endl;
  2020.                 cout << endl;
  2021.                 quantity();
  2022.             }
  2023.             else fishInvPol -= qty;
  2024.         }
  2025.         else if (goodType==3 && mem3==0){
  2026.             if (qty>woolInvPol){
  2027.                 cout << setw(62);
  2028.                 cout << "Poland does not have " << qty << " wool cloth.";
  2029.                 cout << endl;
  2030.                 cout << endl;
  2031.                 quantity();
  2032.             }
  2033.             else woolInvPol -= qty;
  2034.         }
  2035.         else if (goodType==4 && mem3==0){
  2036.             if (qty>velvetInvPol){
  2037.                 cout << setw(62);
  2038.                 cout << "Poland does not have " << qty << " velvet.";
  2039.                 cout << endl;
  2040.                 cout << endl;
  2041.                 quantity();
  2042.             }
  2043.             else oilInvPol -= qty;
  2044.         }
  2045.         else if (goodType==5 && mem3==0){
  2046.             if (qty>toolsInvPol){
  2047.                 cout << setw(62);
  2048.                 cout << "Poland does not have " << qty << " tools.";
  2049.                 cout << endl;
  2050.                 cout << endl;
  2051.                 quantity();
  2052.             }
  2053.             else toolsInvPol -= qty;
  2054.         }
  2055.         else if (goodType==6 && mem3==0){
  2056.             if (qty>spiceInvPol){
  2057.                 cout << setw(62);
  2058.                 cout << "Poland does not have " << qty << " spice.";
  2059.                 cout << endl;
  2060.                 cout << endl;
  2061.                 quantity();
  2062.             }
  2063.             else spiceInvPol -= qty;
  2064.         }
  2065.         else if (goodType==7 && mem3==0){
  2066.             if (qty>ironInvPol){
  2067.                 cout << setw(62);
  2068.                 cout << "Poland does not have " << qty << " iron.";
  2069.                 cout << endl;
  2070.                 cout << endl;
  2071.                 quantity();
  2072.             }
  2073.             else ironInvPol -= qty;
  2074.         }
  2075.         else if (goodType==8 && mem3==0){
  2076.             if (qty>flourInvPol){
  2077.                 cout << setw(62);
  2078.                 cout << "Poland does not have " << qty << " flour.";
  2079.                 cout << endl;
  2080.                 cout << endl;
  2081.                 quantity();
  2082.             }
  2083.             else flourInvPol -= qty;
  2084.         }
  2085.         else if (goodType==9 && mem3==0){
  2086.             if (qty>dyeInvPol){
  2087.                 cout << setw(62);
  2088.                 cout << "Poland does not have " << qty << " dyes.";
  2089.                 cout << endl;
  2090.                 cout << endl;
  2091.                 quantity();
  2092.             }
  2093.             else dyeInvPol -= qty;
  2094.         }
  2095.         else if (goodType==10 && mem3==0){
  2096.             if (qty>leatherInvPol){
  2097.                 cout << setw(62);
  2098.                 cout << "Poland does not have " << qty << " leatherworks.";
  2099.                 cout << endl;
  2100.                 cout << endl;
  2101.                 quantity();
  2102.             }
  2103.             else leatherInvPol -= qty;
  2104.         }
  2105.         else if (goodType==11 && mem3==0){
  2106.             if (qty>furInvPol){
  2107.                 cout << setw(62);
  2108.                 cout << "Poland does not have " << qty << " fur.";
  2109.                 cout << endl;
  2110.                 cout << endl;
  2111.                 quantity();
  2112.             }
  2113.             else furInvPol -= qty;
  2114.         }
  2115.         else if (goodType==12 && mem3==0){
  2116.             if (qty>beerInvPol){
  2117.                 cout << setw(62);
  2118.                 cout << "Poland does not have " << qty << " beer.";
  2119.                 cout << endl;
  2120.                 cout << endl;
  2121.                 quantity();
  2122.             }
  2123.             else beerInvPol -= qty;
  2124.         }
  2125.         else if (goodType==13 && mem3==0){
  2126.             if (qty>saltInvPol){
  2127.                 cout << setw(62);
  2128.                 cout << "Poland does not have " << qty << " salt.";
  2129.                 cout << endl;
  2130.                 cout << endl;
  2131.                 quantity();
  2132.             }
  2133.             else saltInvPol -= qty;
  2134.         }
  2135.         else if (goodType==14 && mem3==0){
  2136.             if (qty>wineInvPol){
  2137.                 cout << setw(62);
  2138.                 cout << "Poland does not have " << qty << " wine.";
  2139.                 cout << endl;
  2140.                 cout << endl;
  2141.                 quantity();
  2142.             }
  2143.             else wineInvPol -= qty;
  2144.         }
  2145.        
  2146.         //Sell
  2147.         else if (goodType==0 && mem3==1){
  2148.             potInvPol += qty;
  2149.         }
  2150.         else if (goodType== 1 && mem3==1){
  2151.             oilInvPol += qty;
  2152.         }
  2153.         else if (goodType== 2 && mem3==1){
  2154.             fishInvPol += qty;
  2155.         }
  2156.         else if (goodType== 3 && mem3==1){
  2157.             woolInvPol += qty;
  2158.         }
  2159.         else if (goodType== 4 && mem3==1){
  2160.             velvetInvPol += qty;
  2161.         }
  2162.         else if (goodType== 5 && mem3==1){
  2163.             toolsInvPol += qty;
  2164.         }
  2165.         else if (goodType== 6 && mem3==1){
  2166.             spiceInvPol += qty;
  2167.         }
  2168.         else if (goodType== 7 && mem3==1){
  2169.             ironInvPol += qty;
  2170.         }
  2171.         else if (goodType== 8 && mem3==1){
  2172.             flourInvPol += qty;
  2173.         }
  2174.         else if (goodType== 9 && mem3==1){
  2175.             dyeInvPol += qty;
  2176.         }
  2177.         else if (goodType== 10 && mem3==1){
  2178.             leatherInvPol += qty;
  2179.         }
  2180.         else if (goodType== 11 && mem3==1){
  2181.             furInvPol += qty;
  2182.         }
  2183.         else if (goodType== 12 && mem3==1){
  2184.             beerInvPol += qty;
  2185.         }
  2186.         else if (goodType== 13 && mem3==1){
  2187.             saltInvPol += qty;
  2188.         }
  2189.         else if (goodType== 14 && mem3==1){
  2190.             wineInvPol += qty;
  2191.         }
  2192.     }
  2193.     else if (land==2){
  2194.         //Buy
  2195.         if (goodType==0 && mem3==0){
  2196.             if (qty>potInvRus){
  2197.                 cout << setw(62);
  2198.                 cout << "Russia does not have " << qty << " pottery.";
  2199.                 cout << endl;
  2200.                 cout << endl;
  2201.                 quantity();
  2202.             }
  2203.             else potInvRus -= qty;
  2204.         }
  2205.         else if (goodType==1 && mem3==0){
  2206.             if (qty>oilInvRus){
  2207.                 cout << setw(62);
  2208.                 cout << "Russia does not have " << qty << " oil.";
  2209.                 cout << endl;
  2210.                 cout << endl;
  2211.                 quantity();
  2212.             }
  2213.             else oilInvRus -= qty;
  2214.         }
  2215.         else if (goodType==2 && mem3==0){
  2216.             if (qty>fishInvRus){
  2217.                 cout << setw(62);
  2218.                 cout << "Russia does not have " << qty << " fish.";
  2219.                 cout << endl;
  2220.                 cout << endl;
  2221.                 quantity();
  2222.             }
  2223.             else fishInvRus -= qty;
  2224.         }
  2225.         else if (goodType==3 && mem3==0){
  2226.             if (qty>woolInvRus){
  2227.                 cout << setw(62);
  2228.                 cout << "Russia does not have " << qty << " wool cloth.";
  2229.                 cout << endl;
  2230.                 cout << endl;
  2231.                 quantity();
  2232.             }
  2233.             else woolInvRus -= qty;
  2234.         }
  2235.         else if (goodType==4 && mem3==0){
  2236.             if (qty>velvetInvRus){
  2237.                 cout << setw(62);
  2238.                 cout << "Russia does not have " << qty << " velvet.";
  2239.                 cout << endl;
  2240.                 cout << endl;
  2241.                 quantity();
  2242.             }
  2243.             else velvetInvRus -= qty;
  2244.         }
  2245.         else if (goodType==5 && mem3==0){
  2246.             if (qty>toolsInvRus){
  2247.                 cout << setw(62);
  2248.                 cout << "Russia does not have " << qty << " tools.";
  2249.                 cout << endl;
  2250.                 cout << endl;
  2251.                 quantity();
  2252.             }
  2253.             else toolsInvRus -= qty;
  2254.         }
  2255.         else if (goodType==6 && mem3==0){
  2256.             if (qty>spiceInvRus){
  2257.                 cout << setw(62);
  2258.                 cout << "Russia does not have " << qty << " spice.";
  2259.                 cout << endl;
  2260.                 cout << endl;
  2261.                 quantity();
  2262.             }
  2263.             else spiceInvRus -= qty;
  2264.         }
  2265.         else if (goodType==7 && mem3==0){
  2266.             if (qty>ironInvRus){
  2267.                 cout << setw(62);
  2268.                 cout << "Russia does not have " << qty << " iron.";
  2269.                 cout << endl;
  2270.                 cout << endl;
  2271.                 quantity();
  2272.             }
  2273.             else ironInvRus -= qty;
  2274.         }
  2275.         else if (goodType==8 && mem3==0){
  2276.             if (qty>flourInvRus){
  2277.                 cout << setw(62);
  2278.                 cout << "Russia does not have " << qty << " flour.";
  2279.                 cout << endl;
  2280.                 cout << endl;
  2281.                 quantity();
  2282.             }
  2283.             else flourInvRus -= qty;
  2284.         }
  2285.         else if (goodType==9 && mem3==0){
  2286.             if (qty>dyeInvRus){
  2287.                 cout << setw(62);
  2288.                 cout << "Russia does not have " << qty << " dyes.";
  2289.                 cout << endl;
  2290.                 cout << endl;
  2291.                 quantity();
  2292.             }
  2293.             else dyeInvRus -= qty;
  2294.         }
  2295.         else if (goodType==10 && mem3==0){
  2296.             if (qty>leatherInvRus){
  2297.                 cout << setw(62);
  2298.                 cout << "Russia does not have " << qty << " leatherworks.";
  2299.                 cout << endl;
  2300.                 cout << endl;
  2301.                 quantity();
  2302.             }
  2303.             else leatherInvRus -= qty;
  2304.         }
  2305.         else if (goodType==11 && mem3==0){
  2306.             if (qty>furInvRus){
  2307.                 cout << setw(62);
  2308.                 cout << "Russia does not have " << qty << " fur.";
  2309.                 cout << endl;
  2310.                 cout << endl;
  2311.                 quantity();
  2312.             }
  2313.             else furInvRus -= qty;
  2314.         }
  2315.         else if (goodType==12 && mem3==0){
  2316.             if (qty>beerInvRus){
  2317.                 cout << setw(62);
  2318.                 cout << "Russia does not have " << qty << " beer.";
  2319.                 cout << endl;
  2320.                 cout << endl;
  2321.                 quantity();
  2322.             }
  2323.             else beerInvRus -= qty;
  2324.         }
  2325.         else if (goodType==13 && mem3==0){
  2326.             if (qty>saltInvRus){
  2327.                 cout << setw(62);
  2328.                 cout << "Russia does not have " << qty << "salt.";
  2329.                 cout << endl;
  2330.                 cout << endl;
  2331.                 quantity();
  2332.             }
  2333.             else saltInvRus -= qty;
  2334.         }
  2335.         else if (goodType==14 && mem3==0){
  2336.             if (qty>wineInvRus){
  2337.                 cout << setw(62);
  2338.                 cout << "Russia does not have " << qty << " wine.";
  2339.                 cout << endl;
  2340.                 cout << endl;
  2341.                 quantity();
  2342.             }
  2343.             else wineInvRus -= qty;
  2344.         }
  2345.         //Sell
  2346.         else if (goodType==0 && mem3==1){
  2347.             potInvRus += qty;
  2348.         }
  2349.         else if (goodType==1 && mem3==1){
  2350.             oilInvRus += qty;
  2351.         }
  2352.         else if (goodType==2 && mem3==1){
  2353.             fishInvRus += qty;
  2354.         }
  2355.         else if (goodType==3 && mem3==1){
  2356.             woolInvRus += qty;
  2357.         }
  2358.         else if (goodType==4 && mem3==1){
  2359.             velvetInvRus += qty;
  2360.         }
  2361.         else if (goodType==5 && mem3==1){
  2362.             toolsInvRus += qty;
  2363.         }
  2364.         else if (goodType==6 && mem3==1){
  2365.             spiceInvRus += qty;
  2366.         }
  2367.         else if (goodType==7 && mem3==1){
  2368.             ironInvRus += qty;
  2369.         }
  2370.         else if (goodType==8 && mem3==1){
  2371.             flourInvRus += qty;
  2372.         }
  2373.         else if (goodType==9 && mem3==1){
  2374.             dyeInvRus += qty;
  2375.         }
  2376.         else if (goodType==10 && mem3==1){
  2377.             leatherInvRus += qty;
  2378.         }
  2379.         else if (goodType==11 && mem3==1){
  2380.             furInvRus += qty;
  2381.         }
  2382.         else if (goodType==12 && mem3==1){
  2383.             beerInvRus += qty;
  2384.         }
  2385.         else if (goodType==13 && mem3==1){
  2386.             saltInvRus += qty;
  2387.         }
  2388.         else if (goodType==14 && mem3==1){
  2389.             wineInvRus += qty;
  2390.         }
  2391.     }
  2392.    else if (land==3){
  2393.         //Buy
  2394.         if (goodType==0 && mem3==0){
  2395.             if (qty>potInvCri){
  2396.                 cout << setw(62);
  2397.                 cout << "Crimea does not have " << qty << " pottery.";
  2398.                 cout << endl;
  2399.                 cout << endl;
  2400.                 quantity();
  2401.             }
  2402.             else potInvCri -= qty;
  2403.         }
  2404.         else if (goodType==1 && mem3==0){
  2405.             if (qty>oilInvCri){
  2406.                 cout << setw(62);
  2407.                 cout << "Crimea does not have " << qty << " oil.";
  2408.                 cout << endl;
  2409.                 cout << endl;
  2410.                 quantity();
  2411.             }
  2412.             else oilInvCri -= qty;
  2413.         }
  2414.         else if (goodType==2 && mem3==0){
  2415.             if (qty>fishInvCri){
  2416.                 cout << setw(62);
  2417.                 cout << "Crimea does not have " << qty << " fish.";
  2418.                 cout << endl;
  2419.                 cout << endl;
  2420.                 quantity();
  2421.             }
  2422.             else fishInvCri -= qty;
  2423.         }
  2424.         else if (goodType==3 && mem3==0){
  2425.             if (qty>woolInvCri){
  2426.                 cout << setw(62);
  2427.                 cout << "Crimea does not have " << qty << " wool cloth.";
  2428.                 cout << endl;
  2429.                 cout << endl;
  2430.                 quantity();
  2431.             }
  2432.             else woolInvCri -= qty;
  2433.         }
  2434.         else if (goodType==4 && mem3==0){
  2435.             if (qty>velvetInvCri){
  2436.                 cout << setw(62);
  2437.                 cout << "Crimea does not have " << qty << " velvet.";
  2438.                 cout << endl;
  2439.                 cout << endl;
  2440.                 quantity();
  2441.             }
  2442.             else velvetInvCri -= qty;
  2443.         }
  2444.         else if (goodType==5 && mem3==0){
  2445.             if (qty>toolsInvCri){
  2446.                 cout << setw(62);
  2447.                 cout << "Crimea does not have " << qty << " tools.";
  2448.                 cout << endl;
  2449.                 cout << endl;
  2450.                 quantity();
  2451.             }
  2452.             else toolsInvCri -= qty;
  2453.         }
  2454.         else if (goodType==6 && mem3==0){
  2455.             if (qty>spiceInvCri){
  2456.                 cout << setw(62);
  2457.                 cout << "Crimea does not have " << qty << " spice.";
  2458.                 cout << endl;
  2459.                 cout << endl;
  2460.                 quantity();
  2461.             }
  2462.             else spiceInvCri -= qty;
  2463.         }
  2464.         else if (goodType==7 && mem3==0){
  2465.             if (qty>ironInvCri){
  2466.                 cout << setw(62);
  2467.                 cout << "Crimea does not have " << qty << " iron.";
  2468.                 cout << endl;
  2469.                 cout << endl;
  2470.                 quantity();
  2471.             }
  2472.             else ironInvCri -= qty;
  2473.         }
  2474.         else if (goodType==8 && mem3==0){
  2475.             if (qty>flourInvCri){
  2476.                 cout << setw(62);
  2477.                 cout << "Crimea does not have " << qty << " flour.";
  2478.                 cout << endl;
  2479.                 cout << endl;
  2480.                 quantity();
  2481.             }
  2482.             else flourInvCri -= qty;
  2483.         }
  2484.         else if (goodType==9 && mem3==0){
  2485.             if (qty>dyeInvCri){
  2486.                 cout << setw(62);
  2487.                 cout << "Crimea does not have " << qty << " dyes.";
  2488.                 cout << endl;
  2489.                 cout << endl;
  2490.                 quantity();
  2491.             }
  2492.             else dyeInvCri -= qty;
  2493.         }
  2494.         else if (goodType==10 && mem3==0){
  2495.             if (qty>leatherInvCri){
  2496.                 cout << setw(62);
  2497.                 cout << "Crimea does not have " << qty << " leatherworks.";
  2498.                 cout << endl;
  2499.                 cout << endl;
  2500.                 quantity();
  2501.             }
  2502.             else leatherInvCri -= qty;
  2503.         }
  2504.         else if (goodType==11 && mem3==0){
  2505.             if (qty>furInvCri){
  2506.                 cout << setw(62);
  2507.                 cout << "Crimea does not have " << qty << " fur.";
  2508.                 cout << endl;
  2509.                 cout << endl;
  2510.                 quantity();
  2511.             }
  2512.             else furInvCri -= qty;
  2513.         }
  2514.         else if (goodType==12 && mem3==0){
  2515.             if (qty>beerInvCri){
  2516.                 cout << setw(62);
  2517.                 cout << "Crimea does not have " << qty << " beer.";
  2518.                 cout << endl;
  2519.                 cout << endl;
  2520.                 quantity();
  2521.             }
  2522.             else beerInvCri -= qty;
  2523.         }
  2524.         else if (goodType==13 && mem3==0){
  2525.             if (qty>saltInvCri){
  2526.                 cout << setw(62);
  2527.                 cout << "Crimea does not have " << qty << "salt.";
  2528.                 cout << endl;
  2529.                 cout << endl;
  2530.                 quantity();
  2531.             }
  2532.             else saltInvCri -= qty;
  2533.         }
  2534.         else if (goodType==14 && mem3==0){
  2535.             if (qty>wineInvCri){
  2536.                 cout << setw(62);
  2537.                 cout << "Crimea does not have " << qty << " wine.";
  2538.                 cout << endl;
  2539.                 cout << endl;
  2540.                 quantity();
  2541.             }
  2542.             else wineInvCri -= qty;
  2543.         }
  2544.         //Sell
  2545.         else if (goodType==0 && mem3==1){
  2546.             potInvCri += qty;
  2547.         }
  2548.         else if (goodType==1 && mem3==1){
  2549.             oilInvCri += qty;
  2550.         }
  2551.         else if (goodType==2 && mem3==1){
  2552.             fishInvCri += qty;
  2553.         }
  2554.         else if (goodType==3 && mem3==1){
  2555.             woolInvCri += qty;
  2556.         }
  2557.         else if (goodType==4 && mem3==1){
  2558.             velvetInvCri += qty;
  2559.         }
  2560.         else if (goodType==5 && mem3==1){
  2561.             toolsInvCri += qty;
  2562.         }
  2563.         else if (goodType==6 && mem3==1){
  2564.             spiceInvCri += qty;
  2565.         }
  2566.         else if (goodType==7 && mem3==1){
  2567.             ironInvCri += qty;
  2568.         }
  2569.         else if (goodType==8 && mem3==1){
  2570.             flourInvCri += qty;
  2571.         }
  2572.         else if (goodType==9 && mem3==1){
  2573.             dyeInvCri += qty;
  2574.         }
  2575.         else if (goodType==10 && mem3==1){
  2576.             leatherInvCri += qty;
  2577.         }
  2578.         else if (goodType==11 && mem3==1){
  2579.             furInvCri += qty;
  2580.         }
  2581.         else if (goodType==12 && mem3==1){
  2582.             beerInvCri += qty;
  2583.         }
  2584.         else if (goodType==13 && mem3==1){
  2585.             saltInvCri += qty;
  2586.         }
  2587.         else if (goodType==14 && mem3==1){
  2588.             wineInvCri += qty;
  2589.         }
  2590.     }
  2591.     else if (land==4){
  2592.         //Buy
  2593.         if (goodType==0 && mem3==0){
  2594.             if (qty>potInvSau){
  2595.                 cout << setw(62);
  2596.                 cout << "Saudi Arabia does not have " << qty << " pottery.";
  2597.                 cout << endl;
  2598.                 cout << endl;
  2599.                 quantity();
  2600.             }
  2601.             else potInvSau -= qty;
  2602.         }
  2603.         else if (goodType==1 && mem3==0){
  2604.             if (qty>oilInvSau){
  2605.                 cout << setw(62);
  2606.                 cout << "Saudi Arabia does not have " << qty << " oil.";
  2607.                 cout << endl;
  2608.                 cout << endl;
  2609.                 quantity();
  2610.             }
  2611.             else oilInvSau -= qty;
  2612.         }
  2613.         else if (goodType==2 && mem3==0){
  2614.             if (qty>fishInvSau){
  2615.                 cout << setw(62);
  2616.                 cout << "Saudi Arabia does not have " << qty << " fish.";
  2617.                 cout << endl;
  2618.                 cout << endl;
  2619.                 quantity();
  2620.             }
  2621.             else fishInvSau -= qty;
  2622.         }
  2623.         else if (goodType==3 && mem3==0){
  2624.             if (qty>woolInvSau){
  2625.                 cout << setw(62);
  2626.                 cout << "Saudi Arabia does not have " << qty << " wool cloth.";
  2627.                 cout << endl;
  2628.                 cout << endl;
  2629.                 quantity();
  2630.             }
  2631.             else woolInvSau -= qty;
  2632.         }
  2633.         else if (goodType==4 && mem3==0){
  2634.             if (qty>velvetInvSau){
  2635.                 cout << setw(62);
  2636.                 cout << "Saudi Arabia does not have " << qty << " velvet.";
  2637.                 cout << endl;
  2638.                 cout << endl;
  2639.                 quantity();
  2640.             }
  2641.             else velvetInvSau -= qty;
  2642.         }
  2643.         else if (goodType==5 && mem3==0){
  2644.             if (qty>toolsInvSau){
  2645.                 cout << setw(62);
  2646.                 cout << "Saudi Arabia does not have " << qty << " tools.";
  2647.                 cout << endl;
  2648.                 cout << endl;
  2649.                 quantity();
  2650.             }
  2651.             else toolsInvSau -= qty;
  2652.         }
  2653.         else if (goodType==6 && mem3==0){
  2654.             if (qty>spiceInvSau){
  2655.                 cout << setw(62);
  2656.                 cout << "Saudi Arabia does not have " << qty << " spice.";
  2657.                 cout << endl;
  2658.                 cout << endl;
  2659.                 quantity();
  2660.             }
  2661.             else spiceInvSau -= qty;
  2662.         }
  2663.         else if (goodType==7 && mem3==0){
  2664.             if (qty>ironInvSau){
  2665.                 cout << setw(62);
  2666.                 cout << "Saudi Arabia does not have " << qty << " iron.";
  2667.                 cout << endl;
  2668.                 cout << endl;
  2669.                 quantity();
  2670.             }
  2671.             else ironInvSau -= qty;
  2672.         }
  2673.         else if (goodType==8 && mem3==0){
  2674.             if (qty>flourInvSau){
  2675.                 cout << setw(62);
  2676.                 cout << "Saudi Arabia does not have " << qty << " flour.";
  2677.                 cout << endl;
  2678.                 cout << endl;
  2679.                 quantity();
  2680.             }
  2681.             else flourInvSau -= qty;
  2682.         }
  2683.         else if (goodType==9 && mem3==0){
  2684.             if (qty>dyeInvSau){
  2685.                 cout << setw(62);
  2686.                 cout << "Saudi Arabia does not have " << qty << " dyes.";
  2687.                 cout << endl;
  2688.                 cout << endl;
  2689.                 quantity();
  2690.             }
  2691.             else dyeInvSau -= qty;
  2692.         }
  2693.         else if (goodType==10 && mem3==0){
  2694.             if (qty>leatherInvSau){
  2695.                 cout << setw(62);
  2696.                 cout << "Saudi Arabia does not have " << qty << " leatherworks.";
  2697.                 cout << endl;
  2698.                 cout << endl;
  2699.                 quantity();
  2700.             }
  2701.             else leatherInvSau -= qty;
  2702.         }
  2703.         else if (goodType==11 && mem3==0){
  2704.             if (qty>furInvSau){
  2705.                 cout << setw(62);
  2706.                 cout << "Saudi Arabia does not have " << qty << " fur.";
  2707.                 cout << endl;
  2708.                 cout << endl;
  2709.                 quantity();
  2710.             }
  2711.             else furInvSau -= qty;
  2712.         }
  2713.         else if (goodType==12 && mem3==0){
  2714.             if (qty>beerInvSau){
  2715.                 cout << setw(62);
  2716.                 cout << "Saudi Arabia does not have " << qty << " beer.";
  2717.                 cout << endl;
  2718.                 cout << endl;
  2719.                 quantity();
  2720.             }
  2721.             else beerInvSau -= qty;
  2722.         }
  2723.         else if (goodType==13 && mem3==0){
  2724.             if (qty>saltInvSau){
  2725.                 cout << setw(62);
  2726.                 cout << "Saudi Arabia does not have " << qty << " salt.";
  2727.                 cout << endl;
  2728.                 cout << endl;
  2729.                 quantity();
  2730.             }
  2731.             else saltInvSau -= qty;
  2732.         }
  2733.         else if (goodType==14 && mem3==0){
  2734.             if (qty>wineInvSau){
  2735.                 cout << setw(62);
  2736.                 cout << "Saudi Arabia does not have " << qty << " wine.";
  2737.                 cout << endl;
  2738.                 cout << endl;
  2739.                 quantity();
  2740.             }
  2741.             else wineInvSau -= qty;
  2742.         }
  2743.         //Sell
  2744.         else if (goodType==0 && mem3==1){
  2745.             potInvSau += qty;
  2746.         }
  2747.         else if (goodType==1 && mem3==1){
  2748.             oilInvSau += qty;
  2749.         }
  2750.         else if (goodType==2 && mem3==1){
  2751.             fishInvSau += qty;
  2752.         }
  2753.         else if (goodType==3 && mem3==1){
  2754.             woolInvSau += qty;
  2755.         }
  2756.         else if (goodType==4 && mem3==1){
  2757.             velvetInvSau += qty;
  2758.         }
  2759.         else if (goodType==5 && mem3==1){
  2760.             toolsInvSau += qty;
  2761.         }
  2762.         else if (goodType==6 && mem3==1){
  2763.             spiceInvSau += qty;
  2764.         }
  2765.         else if (goodType==7 && mem3==1){
  2766.             ironInvSau += qty;
  2767.         }
  2768.         else if (goodType==8 && mem3==1){
  2769.             flourInvSau += qty;
  2770.         }
  2771.         else if (goodType==9 && mem3==1){
  2772.             dyeInvSau += qty;
  2773.         }
  2774.         else if (goodType==10 && mem3==1){
  2775.             leatherInvSau += qty;
  2776.         }
  2777.         else if (goodType==11 && mem3==1){
  2778.             furInvSau += qty;
  2779.         }
  2780.         else if (goodType==12 && mem3==1){
  2781.             beerInvSau += qty;
  2782.         }
  2783.         else if (goodType==13 && mem3==1){
  2784.             saltInvSau += qty;
  2785.         }
  2786.         else if (goodType==14 && mem3==1){
  2787.             wineInvSau += qty;
  2788.         }
  2789.     }
  2790.     else if (land==5){
  2791.         //Buy
  2792.         if (goodType==0 && mem3==0){
  2793.             if (qty>potInvUkr){
  2794.                 cout << setw(62);
  2795.                 cout << "Ukraine does not have " << qty << " pottery.";
  2796.                 cout << endl;
  2797.                 cout << endl;
  2798.                 quantity();
  2799.             }
  2800.             else potInvUkr -= qty;
  2801.         }
  2802.         else if (goodType==1 && mem3==0){
  2803.             if (qty>oilInvUkr){
  2804.                 cout << setw(62);
  2805.                 cout << "Ukraine does not have " << qty << " oil.";
  2806.                 cout << endl;
  2807.                 cout << endl;
  2808.                 quantity();
  2809.             }
  2810.             else oilInvUkr -= qty;
  2811.         }
  2812.         else if (goodType==2 && mem3==0){
  2813.             if (qty>fishInvUkr){
  2814.                 cout << setw(62);
  2815.                 cout << "Ukraine does not have " << qty << " fish.";
  2816.                 cout << endl;
  2817.                 cout << endl;
  2818.                 quantity();
  2819.             }
  2820.             else fishInvUkr -= qty;
  2821.         }
  2822.         else if (goodType==3 && mem3==0){
  2823.             if (qty>woolInvUkr){
  2824.                 cout << setw(62);
  2825.                 cout << "Ukraine does not have " << qty << " wool cloth.";
  2826.                 cout << endl;
  2827.                 cout << endl;
  2828.                 quantity();
  2829.             }
  2830.             else woolInvUkr -= qty;
  2831.         }
  2832.         else if (goodType==4 && mem3==0){
  2833.             if (qty>velvetInvUkr){
  2834.                 cout << setw(62);
  2835.                 cout << "Ukraine does not have " << qty << " velvet.";
  2836.                 cout << endl;
  2837.                 cout << endl;
  2838.                 quantity();
  2839.             }
  2840.             else velvetInvUkr -= qty;
  2841.         }
  2842.         else if (goodType==5 && mem3==0){
  2843.             if (qty>toolsInvUkr){
  2844.                 cout << setw(62);
  2845.                 cout << "Ukraine does not have " << qty << " tools.";
  2846.                 cout << endl;
  2847.                 cout << endl;
  2848.                 quantity();
  2849.             }
  2850.             else toolsInvUkr -= qty;
  2851.         }
  2852.         else if (goodType==6 && mem3==0){
  2853.             if (qty>spiceInvUkr){
  2854.                 cout << setw(62);
  2855.                 cout << "Ukraine does not have " << qty << " spice.";
  2856.                 cout << endl;
  2857.                 cout << endl;
  2858.                 quantity();
  2859.             }
  2860.             else spiceInvUkr -= qty;
  2861.         }
  2862.         else if (goodType==7 && mem3==0){
  2863.             if (qty>ironInvUkr){
  2864.                 cout << setw(62);
  2865.                 cout << "Ukraine does not have " << qty << " iron.";
  2866.                 cout << endl;
  2867.                 cout << endl;
  2868.                 quantity();
  2869.             }
  2870.             else ironInvUkr -= qty;
  2871.         }
  2872.         else if (goodType==8 && mem3==0){
  2873.             if (qty>flourInvUkr){
  2874.                 cout << setw(62);
  2875.                 cout << "Ukraine does not have " << qty << " flour.";
  2876.                 cout << endl;
  2877.                 cout << endl;
  2878.                 quantity();
  2879.             }
  2880.             else flourInvUkr -= qty;
  2881.         }
  2882.         else if (goodType==9 && mem3==0){
  2883.             if (qty>dyeInvUkr){
  2884.                 cout << setw(62);
  2885.                 cout << "Ukraine does not have " << qty << " dyes.";
  2886.                 cout << endl;
  2887.                 cout << endl;
  2888.                 quantity();
  2889.             }
  2890.             else dyeInvUkr -= qty;
  2891.         }
  2892.         else if (goodType==10 && mem3==0){
  2893.             if (qty>leatherInvUkr){
  2894.                 cout << setw(62);
  2895.                 cout << "Ukraine does not have " << qty << " leatherworks.";
  2896.                 cout << endl;
  2897.                 cout << endl;
  2898.                 quantity();
  2899.             }
  2900.             else leatherInvUkr -= qty;
  2901.         }
  2902.         else if (goodType==11 && mem3==0){
  2903.             if (qty>furInvUkr){
  2904.                 cout << setw(62);
  2905.                 cout << "Ukraine does not have " << qty << " fur.";
  2906.                 cout << endl;
  2907.                 cout << endl;
  2908.                 quantity();
  2909.             }
  2910.             else furInvUkr -= qty;
  2911.         }
  2912.         else if (goodType==12 && mem3==0){
  2913.             if (qty>beerInvUkr){
  2914.                 cout << setw(62);
  2915.                 cout << "Ukraine does not have " << qty << " beer.";
  2916.                 cout << endl;
  2917.                 cout << endl;
  2918.                 quantity();
  2919.             }
  2920.             else beerInvUkr -= qty;
  2921.         }
  2922.         else if (goodType==13 && mem3==0){
  2923.             if (qty>saltInvUkr){
  2924.                 cout << setw(62);
  2925.                 cout << "Ukraine does not have " << qty << " salt.";
  2926.                 cout << endl;
  2927.                 cout << endl;
  2928.                 quantity();
  2929.             }
  2930.             else saltInvUkr -= qty;
  2931.         }
  2932.         else if (goodType==14 && mem3==0){
  2933.             if (qty>wineInvUkr){
  2934.                 cout << setw(62);
  2935.                 cout << "Ukraine does not have " << qty << " wine.";
  2936.                 cout << endl;
  2937.                 cout << endl;
  2938.                 quantity();
  2939.             }
  2940.             else wineInvUkr -= qty;
  2941.         }
  2942.         //Sell
  2943.         else if (goodType==0 && mem3==1){
  2944.             potInvUkr += qty;
  2945.         }
  2946.         else if (goodType==1 && mem3==1){
  2947.             oilInvUkr += qty;
  2948.         }
  2949.         else if (goodType==2 && mem3==1){
  2950.             fishInvUkr += qty;
  2951.         }
  2952.         else if (goodType==3 && mem3==1){
  2953.             woolInvUkr += qty;
  2954.         }
  2955.         else if (goodType==4 && mem3==1){
  2956.             velvetInvUkr += qty;
  2957.         }
  2958.         else if (goodType==5 && mem3==1){
  2959.             toolsInvUkr += qty;
  2960.         }
  2961.         else if (goodType==6 && mem3==1){
  2962.             spiceInvUkr += qty;
  2963.         }
  2964.         else if (goodType==7 && mem3==1){
  2965.             ironInvUkr += qty;
  2966.         }
  2967.         else if (goodType==8 && mem3==1){
  2968.             flourInvUkr += qty;
  2969.         }
  2970.         else if (goodType==9 && mem3==1){
  2971.             dyeInvUkr += qty;
  2972.         }
  2973.         else if (goodType==10 && mem3==1){
  2974.             leatherInvUkr += qty;
  2975.         }
  2976.         else if (goodType==11 && mem3==1){
  2977.             furInvUkr += qty;
  2978.         }
  2979.         else if (goodType==12 && mem3==1){
  2980.             beerInvUkr += qty;
  2981.         }
  2982.         else if (goodType==13 && mem3==1){
  2983.             saltInvUkr += qty;
  2984.         }
  2985.         else if (goodType==14 && mem3==1){
  2986.             wineInvUkr += qty;
  2987.         }
  2988.     }
  2989.     else if (land==6){
  2990.         //Buy
  2991.         if (goodType==0 && mem3==0){
  2992.             if (qty>potInvChi){
  2993.                 cout << setw(62);
  2994.                 cout << "China does not have " << qty << " pottery.";
  2995.                 cout << endl;
  2996.                 cout << endl;
  2997.                 quantity();
  2998.             }
  2999.             else potInvChi -= qty;
  3000.         }
  3001.         else if (goodType==1 && mem3==0){
  3002.             if (qty>oilInvChi){
  3003.                 cout << setw(62);
  3004.                 cout << "China does not have " << qty << " oil.";
  3005.                 cout << endl;
  3006.                 cout << endl;
  3007.                 quantity();
  3008.             }
  3009.             else oilInvChi -= qty;
  3010.         }
  3011.         else if (goodType==2 && mem3==0){
  3012.             if (qty>fishInvChi){
  3013.                 cout << setw(62);
  3014.                 cout << "China does not have " << qty << " fish.";
  3015.                 cout << endl;
  3016.                 cout << endl;
  3017.                 quantity();
  3018.             }
  3019.             else fishInvChi -= qty;
  3020.         }
  3021.         else if (goodType==3 && mem3==0){
  3022.             if (qty>woolInvChi){
  3023.                 cout << setw(62);
  3024.                 cout << "China does not have " << qty << " wool cloth.";
  3025.                 cout << endl;
  3026.                 cout << endl;
  3027.                 quantity();
  3028.             }
  3029.             else woolInvChi -= qty;
  3030.         }
  3031.         else if (goodType==4 && mem3==0){
  3032.             if (qty>velvetInvChi){
  3033.                 cout << setw(62);
  3034.                 cout << "China does not have " << qty << " velvet.";
  3035.                 cout << endl;
  3036.                 cout << endl;
  3037.                 quantity();
  3038.             }
  3039.             else velvetInvChi -= qty;
  3040.         }
  3041.         else if (goodType==5 && mem3==0){
  3042.             if (qty>toolsInvChi){
  3043.                 cout << setw(62);
  3044.                 cout << "China does not have " << qty << " tools.";
  3045.                 cout << endl;
  3046.                 cout << endl;
  3047.                 quantity();
  3048.             }
  3049.             else toolsInvChi -= qty;
  3050.         }
  3051.         else if (goodType==6 && mem3==0){
  3052.             if (qty>spiceInvChi){
  3053.                 cout << setw(62);
  3054.                 cout << "China does not have " << qty << " spice.";
  3055.                 cout << endl;
  3056.                 cout << endl;
  3057.                 quantity();
  3058.             }
  3059.             else spiceInvChi -= qty;
  3060.         }
  3061.         else if (goodType==7 && mem3==0){
  3062.             if (qty>ironInvChi){
  3063.                 cout << setw(62);
  3064.                 cout << "China does not have " << qty << " iron.";
  3065.                 cout << endl;
  3066.                 cout << endl;
  3067.                 quantity();
  3068.             }
  3069.             else ironInvChi -= qty;
  3070.         }
  3071.         else if (goodType==8 && mem3==0){
  3072.             if (qty>flourInvChi){
  3073.                 cout << setw(62);
  3074.                 cout << "China does not have " << qty << " flour.";
  3075.                 cout << endl;
  3076.                 cout << endl;
  3077.                 quantity();
  3078.             }
  3079.             else flourInvChi -= qty;
  3080.         }
  3081.         else if (goodType==9 && mem3==0){
  3082.             if (qty>dyeInvChi){
  3083.                 cout << setw(62);
  3084.                 cout << "China does not have " << qty << " dyes.";
  3085.                 cout << endl;
  3086.                 cout << endl;
  3087.                 quantity();
  3088.             }
  3089.             else dyeInvChi -= qty;
  3090.         }
  3091.         else if (goodType==10 && mem3==0){
  3092.             if (qty>leatherInvChi){
  3093.                 cout << setw(62);
  3094.                 cout << "China does not have " << qty << " leatherworks.";
  3095.                 cout << endl;
  3096.                 cout << endl;
  3097.                 quantity();
  3098.             }
  3099.             else leatherInvChi -= qty;
  3100.         }
  3101.         else if (goodType==11 && mem3==0){
  3102.             if (qty>furInvChi){
  3103.                 cout << setw(62);
  3104.                 cout << "China does not have " << qty << " fur.";
  3105.                 cout << endl;
  3106.                 cout << endl;
  3107.                 quantity();
  3108.             }
  3109.             else furInvChi -= qty;
  3110.         }
  3111.         else if (goodType==12 && mem3==0){
  3112.             if (qty>beerInvChi){
  3113.                 cout << setw(62);
  3114.                 cout << "China does not have " << qty << " beer.";
  3115.                 cout << endl;
  3116.                 cout << endl;
  3117.                 quantity();
  3118.             }
  3119.             else beerInvChi -= qty;
  3120.         }
  3121.         else if (goodType==13 && mem3==0){
  3122.             if (qty>saltInvChi){
  3123.                 cout << setw(62);
  3124.                 cout << "China does not have " << qty << " salt.";
  3125.                 cout << endl;
  3126.                 cout << endl;
  3127.                 quantity();
  3128.             }
  3129.             else saltInvChi -= qty;
  3130.         }
  3131.         else if (goodType==14 && mem3==0){
  3132.             if (qty>wineInvChi){
  3133.                 cout << setw(62);
  3134.                 cout << "China does not have " << qty << " wine.";
  3135.                 cout << endl;
  3136.                 cout << endl;
  3137.                 quantity();
  3138.             }
  3139.             else wineInvChi -= qty;
  3140.         }
  3141.         //Sell
  3142.         else if (goodType==0 && mem3==1){
  3143.             potInvChi += qty;
  3144.         }
  3145.         else if (goodType==1 && mem3==1){
  3146.             oilInvChi += qty;
  3147.         }
  3148.         else if (goodType==2 && mem3==1){
  3149.             fishInvChi += qty;
  3150.         }
  3151.         else if (goodType==3 && mem3==1){
  3152.             woolInvChi += qty;
  3153.         }
  3154.         else if (goodType==4 && mem3==1){
  3155.             velvetInvChi += qty;
  3156.         }
  3157.         else if (goodType==5 && mem3==1){
  3158.             toolsInvChi += qty;
  3159.         }
  3160.         else if (goodType==6 && mem3==1){
  3161.             spiceInvChi += qty;
  3162.         }
  3163.         else if (goodType==7 && mem3==1){
  3164.             ironInvChi += qty;
  3165.         }
  3166.         else if (goodType==8 && mem3==1){
  3167.             flourInvChi += qty;
  3168.         }
  3169.         else if (goodType==9 && mem3==1){
  3170.             dyeInvChi += qty;
  3171.         }
  3172.         else if (goodType==10 && mem3==1){
  3173.             leatherInvChi += qty;
  3174.         }
  3175.         else if (goodType==11 && mem3==1){
  3176.             furInvChi += qty;
  3177.         }
  3178.         else if (goodType==12 && mem3==1){
  3179.             beerInvChi += qty;
  3180.         }
  3181.         else if (goodType==13 && mem3==1){
  3182.             saltInvChi += qty;
  3183.         }
  3184.         else if (goodType==14 && mem3==1){
  3185.             wineInvChi += qty;
  3186.         }
  3187.     }
  3188.  
  3189. }
  3190.  
  3191.  
  3192. //random function
  3193. void random(void){
  3194.     goodType = 0;
  3195.     for (int i = 1; i <= 15; i++){
  3196.         if (goodType == 0){
  3197.             if (land == 0){
  3198.                 inv_Country = potInvSwede;
  3199.             }
  3200.             else if (land == 1){
  3201.                 inv_Country = potInvPol;
  3202.             }
  3203.             else if (land == 2){
  3204.                 inv_Country = potInvRus;
  3205.             }
  3206.             else if (land == 3){
  3207.                 inv_Country = potInvCri;
  3208.             }
  3209.             else if (land == 4){
  3210.                 inv_Country = potInvSau;
  3211.             }
  3212.             else if (land == 5){
  3213.                 inv_Country = potInvUkr;
  3214.             }
  3215.             else if (land == 6){
  3216.                 inv_Country = potInvChi;
  3217.             }
  3218.            
  3219.             if (inv_Country >= 76 && inv_Country <= 100){
  3220.                 price = potPrice[land] + randomnum * 1;
  3221.             }
  3222.             else if (inv_Country >= 51 && inv_Country <= 75){
  3223.                 price = potPrice[land] * 1.25 + randomnum;
  3224.             }
  3225.             else if (inv_Country >= 26 && inv_Country <= 50){
  3226.                 price = potPrice[land] * 1.50 + randomnum;
  3227.             }
  3228.             else if (inv_Country <= 25){
  3229.                 price = potPrice[land] * 2 + randomnum;
  3230.             }
  3231.             else if (inv_Country > 100){
  3232.                 price = potPrice[land] * 0.5 + randomnum;
  3233.             }
  3234.             priceArrays[0] = price;
  3235.         }
  3236.         else if (goodType == 1){
  3237.             if (land == 0){
  3238.                 inv_Country = oilInvSwede;  
  3239.             }
  3240.             else if (land == 1){
  3241.                 inv_Country = oilInvPol;    
  3242.             }
  3243.             else if (land == 2){
  3244.                 inv_Country = oilInvRus;
  3245.             }
  3246.             //changes
  3247.             else if (land == 3){
  3248.                 inv_Country = oilInvCri;
  3249.             }
  3250.             else if (land == 4){
  3251.                 inv_Country = oilInvSau;
  3252.             }
  3253.             else if (land == 5){
  3254.                 inv_Country = oilInvUkr;
  3255.             }
  3256.             else if (land == 6){
  3257.                 inv_Country = oilInvChi;
  3258.             }
  3259.            
  3260.             if (inv_Country >= 38 && inv_Country <= 50){
  3261.                 price = oilPrice[land] + randomnum;
  3262.             }
  3263.             else if (inv_Country >= 26 && inv_Country <= 37){
  3264.                 price = oilPrice[land] * 1.25 + randomnum;
  3265.             }
  3266.             else if (inv_Country >= 13 && inv_Country <= 25){
  3267.                 price = oilPrice[land] * 1.50 + randomnum;
  3268.             }
  3269.             else if (inv_Country <= 12){
  3270.                 price = oilPrice[land] * 2 + randomnum;
  3271.             }
  3272.             else if (inv_Country > 50){
  3273.                 price = oilPrice[land] * 0.75 + randomnum;
  3274.             }
  3275.             priceArrays[1] = price;
  3276.         }
  3277.         else if (goodType == 2){
  3278.             if (land == 0){
  3279.                 inv_Country = fishInvSwede;  
  3280.             }
  3281.             else if (land == 1){
  3282.                 inv_Country = fishInvPol;    
  3283.             }
  3284.             else if (land == 2){
  3285.                 inv_Country = fishInvRus;
  3286.             }
  3287.             else if (land == 3){
  3288.                 inv_Country = fishInvCri;
  3289.             }
  3290.             else if (land == 4){
  3291.                 inv_Country = fishInvSau;
  3292.             }
  3293.             else if (land == 5){
  3294.                 inv_Country = fishInvUkr;
  3295.             }
  3296.             else if (land == 6){
  3297.                 inv_Country = fishInvChi;
  3298.             }
  3299.            
  3300.             if (inv_Country >= 114 && inv_Country <= 150){
  3301.                 price = fishPrice[land] + randomnum;
  3302.             }
  3303.             else if (inv_Country >= 76 && inv_Country <= 113){
  3304.                 price = fishPrice[land] * 1.25 + randomnum;
  3305.             }
  3306.             else if (inv_Country >= 39 && inv_Country <= 75){
  3307.                 price = fishPrice[land] * 1.50 + randomnum;
  3308.             }
  3309.             else if (inv_Country <= 38){
  3310.                 price = fishPrice[land] * 2 + randomnum;
  3311.             }
  3312.             else if (inv_Country > 150){
  3313.                 price = fishPrice[land] * 0.75 + randomnum;
  3314.             }
  3315.             priceArrays[2] = price;
  3316.         }
  3317.         else if (goodType == 3){
  3318.             if (land == 0){
  3319.                 inv_Country = woolInvSwede;  
  3320.             }
  3321.             else if (land == 1){
  3322.                 inv_Country = woolInvPol;    
  3323.             }
  3324.             else if (land == 2){
  3325.                 inv_Country = woolInvRus;
  3326.             }
  3327.             else if (land == 3){
  3328.                 inv_Country = woolInvCri;
  3329.             }
  3330.             else if (land == 4){
  3331.                 inv_Country = woolInvSau;
  3332.             }
  3333.             else if (land == 5){
  3334.                 inv_Country = woolInvUkr;
  3335.             }
  3336.             else if (land == 6){
  3337.                 inv_Country = woolInvChi;
  3338.             }
  3339.            
  3340.             if (inv_Country >= 38 && inv_Country <= 75){
  3341.                 price = woolPrice[land] + randomnum;
  3342.             }
  3343.             else if (inv_Country >= 26 && inv_Country <= 56){
  3344.                 price = woolPrice[land] * 1.25 + randomnum;
  3345.             }
  3346.             else if (inv_Country >= 13 && inv_Country <= 38){
  3347.                 price = woolPrice[land] * 1.50 + randomnum;
  3348.             }
  3349.             else if (inv_Country <= 12){
  3350.                 price = woolPrice[land] * 2 + randomnum;
  3351.             }
  3352.             else if (inv_Country < 75){
  3353.                 price = woolPrice[land] * 0.75 + randomnum;
  3354.             }
  3355.             priceArrays[3] = price;
  3356.         }
  3357.         else if (goodType == 4){
  3358.             if (land == 0){
  3359.                 inv_Country = velvetInvSwede;  
  3360.             }
  3361.             else if (land == 1){
  3362.                 inv_Country = velvetInvPol;    
  3363.             }
  3364.             else if (land == 2){
  3365.                 inv_Country = velvetInvRus;
  3366.             }
  3367.             else if (land == 3){
  3368.                 inv_Country = velvetInvCri;
  3369.             }
  3370.             else if (land == 4){
  3371.                 inv_Country = velvetInvSau;
  3372.             }
  3373.             else if (land == 5){
  3374.                 inv_Country = velvetInvUkr;
  3375.             }
  3376.             else if (land == 6){
  3377.                 inv_Country = velvetInvChi;
  3378.             }
  3379.            
  3380.             if (inv_Country >= 20 && inv_Country <= 25){
  3381.                 price = velvetPrice[land] + randomnum;
  3382.             }
  3383.             else if (inv_Country >= 14 && inv_Country <= 19){
  3384.                 price = velvetPrice[land] * 1.25 + randomnum;
  3385.             }
  3386.             else if (inv_Country >= 8 && inv_Country <= 13){
  3387.                 price = velvetPrice[land] * 1.50 + randomnum;
  3388.             }
  3389.             else if (inv_Country <= 7){
  3390.                 price = velvetPrice[land] * 2 + randomnum;
  3391.             }
  3392.             else if (inv_Country > 25){
  3393.                 price = velvetPrice[land] * 0.75 + randomnum;
  3394.             }
  3395.             priceArrays[4] = price;
  3396.         }
  3397.         else if (goodType == 5){
  3398.             if (land == 0){
  3399.                 inv_Country = toolsInvSwede;  
  3400.             }
  3401.             else if (land == 1){
  3402.                 inv_Country = toolsInvPol;    
  3403.             }
  3404.             else if (land == 2){
  3405.                 inv_Country = toolsInvRus;
  3406.             }
  3407.            
  3408.             else if (land == 3){
  3409.                 inv_Country = toolsInvCri;
  3410.             }
  3411.             else if (land == 4){
  3412.                 inv_Country = toolsInvSau;
  3413.             }
  3414.             else if (land == 5){
  3415.                 inv_Country = toolsInvUkr;
  3416.             }
  3417.             else if (land == 6){
  3418.                 inv_Country = toolsInvChi;
  3419.             }
  3420.            
  3421.             if (inv_Country >= 38 && inv_Country <= 50){
  3422.                 price = toolsPrice[land] + randomnum;
  3423.                 if (land == 6){
  3424.                     if (price < 0){
  3425.                         price *= -1;
  3426.                     }
  3427.                     price += 350;
  3428.                 }
  3429.             }
  3430.             else if (inv_Country >= 26 && inv_Country <= 37){
  3431.                 price = toolsPrice[land] * 1.25 + randomnum;
  3432.                 if (land == 6){
  3433.                     if (price < 0){
  3434.                         price *= -1;
  3435.                     }
  3436.                     price += 350;
  3437.                 }
  3438.             }
  3439.             else if (inv_Country >= 13 && inv_Country <= 25){
  3440.                 price = toolsPrice[land] * 1.50 + randomnum;
  3441.                  if (land == 6){
  3442.                     if (price < 0){
  3443.                         price *= -1;
  3444.                     }
  3445.                     price += 350;
  3446.                 }
  3447.             }
  3448.             else if (inv_Country <= 12){
  3449.                 price = toolsPrice[land] * 2 + randomnum;
  3450.                 if (land == 6){
  3451.                     if (price < 0){
  3452.                         price *= -1;
  3453.                     }
  3454.                     price += 350;
  3455.                 }
  3456.             }
  3457.             else if (inv_Country > 50){
  3458.                 price = toolsPrice[land] * 0.75 + randomnum;
  3459.                 if (land == 6){
  3460.                     if (price < 0){
  3461.                         price *= -1;
  3462.                     }
  3463.                     price += 350;
  3464.                 }
  3465.             }
  3466.             priceArrays[5] = price;
  3467.         }
  3468.         else if (goodType == 6){
  3469.             if (land == 0){
  3470.                 inv_Country = spiceInvSwede;  
  3471.             }
  3472.             else if (land == 1){
  3473.                 inv_Country = spiceInvPol;    
  3474.             }
  3475.             else if (land == 2){
  3476.                 inv_Country = spiceInvRus;
  3477.             }
  3478.             else if (land == 3){
  3479.                 inv_Country = spiceInvCri;
  3480.             }
  3481.             else if (land == 4){
  3482.                 inv_Country = spiceInvSau;
  3483.             }
  3484.             else if (land == 5){
  3485.                 inv_Country = spiceInvUkr;
  3486.             }
  3487.             else if (land == 6){
  3488.                 inv_Country = spiceInvChi;
  3489.             }
  3490.            
  3491.             if (inv_Country >= 24 && inv_Country <= 30){
  3492.                 price = spicePrice[land] + randomnum;
  3493.             }
  3494.             else if (inv_Country >= 16 && inv_Country <= 23){
  3495.                 price = spicePrice[land] * 1.25 + randomnum;
  3496.             }
  3497.             else if (inv_Country >= 9 && inv_Country <= 15){
  3498.                 price = spicePrice[land] * 1.50 + randomnum;
  3499.             }
  3500.             else if (inv_Country <= 8){
  3501.                 price = spicePrice[land] * 2 + randomnum;
  3502.             }
  3503.             else if (inv_Country > 30){
  3504.                 price = spicePrice[land] * 0.75 + randomnum;
  3505.             }
  3506.             priceArrays[6] = price;
  3507.         }
  3508.         else if (goodType == 7){
  3509.             if (land == 0){
  3510.                 inv_Country = ironInvSwede;  
  3511.             }
  3512.             else if (land == 1){
  3513.                 inv_Country = ironInvPol;    
  3514.             }
  3515.             else if (land == 2){
  3516.                 inv_Country = ironInvRus;
  3517.             }
  3518.             else if (land == 3){
  3519.                 inv_Country = ironInvCri;
  3520.             }
  3521.             else if (land == 4){
  3522.                 inv_Country = ironInvSau;
  3523.             }
  3524.             else if (land == 5){
  3525.                 inv_Country = ironInvUkr;
  3526.             }
  3527.             else if (land == 6){
  3528.                 inv_Country = ironInvChi;
  3529.             }
  3530.            
  3531.             if (inv_Country >= 76 && inv_Country <= 100){
  3532.                 price = ironPrice[land] + randomnum;
  3533.             }
  3534.             else if (inv_Country >= 51 && inv_Country <= 75){
  3535.                 price = ironPrice[land] * 1.25 + randomnum;
  3536.             }
  3537.             else if (inv_Country >= 26 && inv_Country <= 50){
  3538.                 price = ironPrice[land] * 1.50 + randomnum;
  3539.             }
  3540.             else if (inv_Country <= 25){
  3541.                 price = ironPrice[land] * 2 + randomnum;
  3542.             }
  3543.             else if (inv_Country > 100){
  3544.                 price = ironPrice[land] * 0.75 + randomnum;
  3545.             }
  3546.             priceArrays[7] = price;
  3547.         }
  3548.         else if (goodType == 8){
  3549.             if (land == 0){
  3550.                 inv_Country = flourInvSwede;  
  3551.             }
  3552.             else if (land == 1){
  3553.                 inv_Country = flourInvPol;    
  3554.             }
  3555.             else if (land == 2){
  3556.                 inv_Country = flourInvRus;
  3557.             }
  3558.             else if (land == 3){
  3559.                 inv_Country = flourInvCri;
  3560.             }
  3561.             else if (land == 4){
  3562.                 inv_Country = flourInvSau;
  3563.             }
  3564.             else if (land == 5){
  3565.                 inv_Country = flourInvUkr;
  3566.             }
  3567.             else if (land == 6){
  3568.                 inv_Country = flourInvChi;
  3569.             }
  3570.            
  3571.             if (inv_Country >= 114 && inv_Country <= 150){
  3572.                 price = flourPrice[land] + randomnum;
  3573.             }
  3574.             else if (inv_Country >= 76 && inv_Country <= 113){
  3575.                 price = flourPrice[land] * 1.25 + randomnum;
  3576.             }
  3577.             else if (inv_Country >= 39 && inv_Country <= 75){
  3578.                 price = flourPrice[land] * 1.50 + randomnum;
  3579.             }
  3580.             else if (inv_Country <= 38){
  3581.                 price = flourPrice[land] * 2 + randomnum;
  3582.             }
  3583.             else if (inv_Country > 150){
  3584.                 price = flourPrice[land] * 0.75 + randomnum;
  3585.             }
  3586.             priceArrays[8] = price;
  3587.         }
  3588.         else if (goodType == 9){
  3589.             if (land == 0){
  3590.                 inv_Country = dyeInvSwede;  
  3591.             }
  3592.             else if (land == 1){
  3593.                 inv_Country = dyeInvPol;    
  3594.             }
  3595.             else if (land == 2){
  3596.                 inv_Country = dyeInvRus;
  3597.             }
  3598.             else if (land == 3){
  3599.                 inv_Country = dyeInvCri;
  3600.             }
  3601.             else if (land == 4){
  3602.                 inv_Country = dyeInvSau;
  3603.             }
  3604.             else if (land == 5){
  3605.                 inv_Country = dyeInvUkr;
  3606.             }
  3607.             else if (land == 6){
  3608.                 inv_Country = dyeInvChi;
  3609.             }
  3610.            
  3611.             if (inv_Country >= 57 && inv_Country <= 75){
  3612.                 price = dyePrice[land] + randomnum;
  3613.             }
  3614.             else if (inv_Country >= 40 && inv_Country <= 56){
  3615.                 price = dyePrice[land] * 1.25 + randomnum;
  3616.             }
  3617.             else if (inv_Country >= 20 && inv_Country <= 39){
  3618.                 price = dyePrice[land] * 1.50 + randomnum;
  3619.             }
  3620.             else if (inv_Country <= 19){
  3621.                 price = dyePrice[land] * 2 + randomnum;
  3622.             }
  3623.             else if (inv_Country > 75){
  3624.                 price = dyePrice[land] * 0.75 + randomnum;
  3625.             }
  3626.             priceArrays[9] = price;
  3627.         }
  3628.         else if (goodType == 10){
  3629.             if (land == 0){
  3630.                 inv_Country = leatherInvSwede;  
  3631.             }
  3632.             else if (land == 1){
  3633.                 inv_Country = leatherInvPol;    
  3634.             }
  3635.             else if (land == 2){
  3636.                 inv_Country = leatherInvRus;
  3637.             }
  3638.             else if (land == 3){
  3639.                 inv_Country = leatherInvCri;
  3640.             }
  3641.             else if (land == 4){
  3642.                 inv_Country = leatherInvSau;
  3643.             }
  3644.             else if (land == 5){
  3645.                 inv_Country = leatherInvUkr;
  3646.             }
  3647.             else if (land == 6){
  3648.                 inv_Country = leatherInvChi;
  3649.             }
  3650.            
  3651.             if (inv_Country >= 57 && inv_Country <= 75){
  3652.                 price = leatherPrice[land] + randomnum;
  3653.             }
  3654.             else if (inv_Country >= 39 && inv_Country <= 56){
  3655.                 price = leatherPrice[land] * 1.25 + randomnum;
  3656.             }
  3657.             else if (inv_Country >= 20 && inv_Country <= 38){
  3658.                 price = leatherPrice[land] * 1.50 + randomnum;
  3659.             }
  3660.             else if (inv_Country <= 19){
  3661.                 price = leatherPrice[land] * 2 + randomnum;
  3662.             }
  3663.             else if (inv_Country > 75){
  3664.                 price = leatherPrice[land] * 0.75 + randomnum;
  3665.             }
  3666.             priceArrays[10] = price;
  3667.         }
  3668.         else if (goodType == 11){
  3669.             if (land == 0){
  3670.                 inv_Country = furInvSwede;  
  3671.             }
  3672.             else if (land == 1){
  3673.                 inv_Country = furInvPol;    
  3674.             }
  3675.             else if (land == 2){
  3676.                 inv_Country = furInvRus;
  3677.             }
  3678.             else if (land == 3){
  3679.                 inv_Country = furInvCri;
  3680.             }
  3681.             else if (land == 4){
  3682.                 inv_Country = furInvSau;
  3683.             }
  3684.             else if (land == 5){
  3685.                 inv_Country = furInvUkr;
  3686.             }
  3687.             else if (land == 6){
  3688.                 inv_Country = furInvChi;
  3689.             }
  3690.            
  3691.             if (inv_Country >= 57 && inv_Country <= 75){
  3692.                 price = furPrice[land] + randomnum;
  3693.             }
  3694.             else if (inv_Country >= 40 && inv_Country <= 56){
  3695.                 price = furPrice[land] * 1.25 + randomnum;
  3696.             }
  3697.             else if (inv_Country >= 20 && inv_Country <= 39){
  3698.                 price = furPrice[land] * 1.50 + randomnum;
  3699.             }
  3700.             else if (inv_Country <= 19){
  3701.                 price = furPrice[land] * 2 + randomnum;
  3702.             }
  3703.             else if (inv_Country > 75){
  3704.                 price = furPrice[land] * 0.75 + randomnum;
  3705.             }
  3706.             priceArrays[11] = price;
  3707.         }
  3708.         else if (goodType == 12){
  3709.             if (land == 0){
  3710.                 inv_Country = beerInvSwede;  
  3711.             }
  3712.             else if (land == 1){
  3713.                 inv_Country = beerInvPol;    
  3714.             }
  3715.             else if (land == 2){
  3716.                 inv_Country = beerInvRus;
  3717.             }
  3718.             else if (land == 3){
  3719.                 inv_Country = beerInvCri;
  3720.             }
  3721.             else if (land == 4){
  3722.                 inv_Country = beerInvSau;
  3723.             }
  3724.             else if (land == 5){
  3725.                 inv_Country = beerInvUkr;
  3726.             }
  3727.             else if (land == 6){
  3728.                 inv_Country = beerInvChi;
  3729.             }
  3730.            
  3731.             if (inv_Country >= 57 && inv_Country <= 75){
  3732.                 price = beerPrice[land] + randomnum;
  3733.             }
  3734.             else if (inv_Country >= 40 && inv_Country <= 56){
  3735.                 price = beerPrice[land] * 1.25 + randomnum;
  3736.             }
  3737.             else if (inv_Country >= 20 && inv_Country <= 39){
  3738.                 price = beerPrice[land] * 1.50 + randomnum;
  3739.             }
  3740.             else if (inv_Country <= 19){
  3741.                 price = beerPrice[land] * 2 + randomnum;
  3742.             }
  3743.             else if (inv_Country > 75){
  3744.                 price = beerPrice[land] * 0.75 + randomnum;
  3745.             }
  3746.             priceArrays[12] = price;
  3747.         }else if (goodType == 13){
  3748.             if (land == 0){
  3749.                 inv_Country = saltInvSwede;  
  3750.             }
  3751.             else if (land == 1){
  3752.                 inv_Country = saltInvPol;    
  3753.             }
  3754.             else if (land == 2){
  3755.                 inv_Country = saltInvRus;
  3756.             }
  3757.             else if (land == 3){
  3758.                 inv_Country = saltInvCri;
  3759.             }
  3760.             else if (land == 4){
  3761.                 inv_Country = saltInvSau;
  3762.             }
  3763.             else if (land == 5){
  3764.                 inv_Country = saltInvUkr;
  3765.             }
  3766.             else if (land == 6){
  3767.                 inv_Country = saltInvChi;
  3768.             }
  3769.            
  3770.             if (inv_Country >= 57 && inv_Country <= 75){
  3771.                 price = saltPrice[land] + randomnum;
  3772.             }
  3773.             else if (inv_Country >= 40 && inv_Country <= 56){
  3774.                 price = saltPrice[land] * 1.25 + randomnum;
  3775.             }
  3776.             else if (inv_Country >= 20 && inv_Country <= 39){
  3777.                 price = saltPrice[land] * 1.50 + randomnum;
  3778.             }
  3779.             else if (inv_Country <= 19){
  3780.                 price = saltPrice[land] * 2 + randomnum;
  3781.             }
  3782.             else if (inv_Country > 50){
  3783.                 price = saltPrice[land] * 0.75 + randomnum;
  3784.             }
  3785.             priceArrays[13] = price;
  3786.         }
  3787.         else if (goodType == 14){
  3788.             if (land == 0){
  3789.                 inv_Country = wineInvSwede;  
  3790.             }
  3791.             else if (land == 1){
  3792.                 inv_Country = wineInvPol;    
  3793.             }
  3794.             else if (land == 2){
  3795.                 inv_Country = wineInvRus;
  3796.             }
  3797.             else if (land == 3){
  3798.                 inv_Country = wineInvCri;
  3799.             }
  3800.             else if (land == 4){
  3801.                 inv_Country = wineInvSau;
  3802.             }
  3803.             else if (land == 5){
  3804.                 inv_Country = wineInvUkr;
  3805.             }
  3806.             else if (land == 6){
  3807.                 inv_Country = wineInvChi;
  3808.             }
  3809.            
  3810.             if (inv_Country >= 57 && inv_Country <= 75){
  3811.                 price = winePrice[land] + randomnum;
  3812.             }
  3813.             else if (inv_Country >= 40 && inv_Country <= 56){
  3814.                 price = winePrice[land] * 1.25 + randomnum;
  3815.             }
  3816.             else if (inv_Country >= 20 && inv_Country <= 39){
  3817.                 price = winePrice[land] * 1.50 + randomnum;
  3818.             }
  3819.             else if (inv_Country <= 19){
  3820.                 price = winePrice[land] * 2 + randomnum;
  3821.             }
  3822.             else if (inv_Country > 75){
  3823.                 price = winePrice[land] * 0.75 + randomnum;
  3824.             }
  3825.             priceArrays[14] = price;
  3826.         }
  3827.         int z;
  3828.         if (i < 10){
  3829.             cout << setw(15) << "[" << i << "] " << setw(18) << tradeGoods[goodType] << setw(15) << " - " << setw(15) << "Eur " << setw(5) << price;   
  3830.         }
  3831.         else if (i >= 10){
  3832.             cout << setw(14) << "[" << i << "] " << setw(18) << tradeGoods[goodType] << setw(15) << " - " << setw(15) << "Eur " << setw(5) << price;
  3833.         }
  3834.        
  3835.         cout << endl;
  3836.         goodType++;
  3837.     }
  3838.  
  3839.     }
  3840.  
  3841. float random(float x){
  3842.     srand(time(0));
  3843.     x = rand() % 20 + (-20);
  3844.     return x;
  3845. }
  3846.  
  3847. //inv country function
  3848. void determineCountry(void){
  3849.     if (land == 0){
  3850.         if (goodType == 0) inv_Country = potInvSwede;
  3851. //      //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
  3852.         else if (goodType == 1) inv_Country = oilInvSwede;
  3853.         //addition
  3854.         else if (goodType == 2) inv_Country = fishInvSwede;
  3855.         else if (goodType == 3) inv_Country = woolInvSwede;
  3856.         else if (goodType == 4) inv_Country = velvetInvSwede;
  3857.         else if (goodType == 5) inv_Country = toolsInvSwede;
  3858.         else if (goodType == 6) inv_Country = spiceInvSwede;
  3859.         else if (goodType == 7) inv_Country = ironInvSwede;
  3860.         else if (goodType == 8) inv_Country = flourInvSwede;
  3861.         else if (goodType == 9) inv_Country = dyeInvSwede;
  3862.         else if (goodType == 10) inv_Country = leatherInvSwede;
  3863.         else if (goodType == 11) inv_Country = furInvSwede;
  3864.         else if (goodType == 12) inv_Country = beerInvSwede;
  3865.         else if (goodType == 13) inv_Country = saltInvSwede;
  3866.         else if (goodType == 14) inv_Country = wineInvSwede;
  3867.        
  3868.     }
  3869.     else if (land == 1){
  3870.         if (goodType == 0) inv_Country = potInvPol;
  3871.         else if (goodType == 1) inv_Country = oilInvPol;
  3872.         else if (goodType == 2) inv_Country = fishInv;
  3873.         else if (goodType == 3) inv_Country = woolInvPol;
  3874.         else if (goodType == 4) inv_Country = velvetInvPol;
  3875.         else if (goodType == 5) inv_Country = toolsInvPol;
  3876.         else if (goodType == 6) inv_Country = spiceInvPol;
  3877.         else if (goodType == 7) inv_Country = ironInvPol;
  3878.         else if (goodType == 8) inv_Country = flourInvPol;
  3879.         else if (goodType == 9) inv_Country = dyeInvPol;
  3880.         else if (goodType == 10) inv_Country = leatherInvPol;
  3881.         else if (goodType == 11) inv_Country = furInvPol;
  3882.         else if (goodType == 12) inv_Country = beerInvPol;
  3883.         else if (goodType == 13) inv_Country = saltInvPol;
  3884.         else if (goodType == 14) inv_Country = wineInvPol;
  3885.     }
  3886.     else if (land == 2){
  3887.         if (goodType == 0) inv_Country = potInvRus;
  3888.         else if (goodType == 1) inv_Country = oilInvRus;
  3889.         else if (goodType == 2) inv_Country = fishInvRus;
  3890.         else if (goodType == 3) inv_Country = woolInvRus;
  3891.         else if (goodType == 4) inv_Country = velvetInvRus;
  3892.         else if (goodType == 5) inv_Country = toolsInvRus;
  3893.         else if (goodType == 6) inv_Country = spiceInvRus;
  3894.         else if (goodType == 7) inv_Country = ironInvRus;
  3895.         else if (goodType == 8) inv_Country = flourInvRus;
  3896.         else if (goodType == 9) inv_Country = dyeInvRus;
  3897.         else if (goodType == 10) inv_Country = leatherInvRus;
  3898.         else if (goodType == 11) inv_Country = furInvRus;
  3899.         else if (goodType == 12) inv_Country = beerInvRus;
  3900.         else if (goodType == 13) inv_Country = saltInvRus;
  3901.         else if (goodType == 14) inv_Country = wineInvRus;
  3902.     }
  3903.     //changes
  3904.     else if (land == 3){
  3905.         if (goodType == 0) inv_Country = potInvCri;
  3906.         else if (goodType == 1) inv_Country = oilInvCri;
  3907.         else if (goodType == 2) inv_Country = fishInvCri;
  3908.         else if (goodType == 3) inv_Country = woolInvCri;
  3909.         else if (goodType == 4) inv_Country = velvetInvCri;
  3910.         else if (goodType == 5) inv_Country = toolsInvCri;
  3911.         else if (goodType == 6) inv_Country = spiceInvCri;
  3912.         else if (goodType == 7) inv_Country = ironInvCri;
  3913.         else if (goodType == 8) inv_Country = flourInvCri;
  3914.         else if (goodType == 9) inv_Country = dyeInvCri;
  3915.         else if (goodType == 10) inv_Country = leatherInvCri;
  3916.         else if (goodType == 11) inv_Country = furInvCri;
  3917.         else if (goodType == 12) inv_Country = beerInvCri;
  3918.         else if (goodType == 13) inv_Country = saltInvCri;
  3919.         else if (goodType == 14) inv_Country = wineInvCri;
  3920.     }
  3921.     else if (land == 4){
  3922.         if (goodType == 0) inv_Country = potInvSau;
  3923.         else if (goodType == 1) inv_Country = oilInvSau;
  3924.         else if (goodType == 2) inv_Country = fishInvSau;
  3925.         else if (goodType == 3) inv_Country = woolInvSau;
  3926.         else if (goodType == 4) inv_Country = velvetInvSau;
  3927.         else if (goodType == 5) inv_Country = toolsInvSau;
  3928.         else if (goodType == 6) inv_Country = spiceInvSau;
  3929.         else if (goodType == 7) inv_Country = ironInvSau;
  3930.         else if (goodType == 8) inv_Country = flourInvSau;
  3931.         else if (goodType == 9) inv_Country = dyeInvSau;
  3932.         else if (goodType == 10) inv_Country = leatherInvSau;
  3933.         else if (goodType == 11) inv_Country = furInvSau;
  3934.         else if (goodType == 12) inv_Country = beerInvSau;
  3935.         else if (goodType == 13) inv_Country = saltInvSau;
  3936.         else if (goodType == 14) inv_Country = wineInvSau;
  3937.     }
  3938.     else if (land == 5){
  3939.         if (goodType == 0) inv_Country = potInvUkr;
  3940.         else if (goodType == 1) inv_Country = oilInvUkr;
  3941.         else if (goodType == 2) inv_Country = fishInvUkr;
  3942.         else if (goodType == 3) inv_Country = woolInvUkr;
  3943.         else if (goodType == 4) inv_Country = velvetInvUkr;
  3944.         else if (goodType == 5) inv_Country = toolsInvUkr;
  3945.         else if (goodType == 6) inv_Country = spiceInvUkr;
  3946.         else if (goodType == 7) inv_Country = ironInvUkr;
  3947.         else if (goodType == 8) inv_Country = flourInvUkr;
  3948.         else if (goodType == 9) inv_Country = dyeInvUkr;
  3949.         else if (goodType == 10) inv_Country = leatherInvUkr;
  3950.         else if (goodType == 11) inv_Country = furInvUkr;
  3951.         else if (goodType == 12) inv_Country = beerInvUkr;
  3952.         else if (goodType == 13) inv_Country = saltInvUkr;
  3953.         else if (goodType == 14) inv_Country = wineInvUkr;
  3954.     }
  3955.     else if (land == 6){
  3956.         if (goodType == 0) inv_Country = potInvChi;
  3957.         else if (goodType == 1) inv_Country = oilInvChi;
  3958.         else if (goodType == 2) inv_Country = fishInvChi;
  3959.         else if (goodType == 3) inv_Country = woolInvChi;
  3960.         else if (goodType == 4) inv_Country = velvetInvChi;
  3961.         else if (goodType == 5) inv_Country = toolsInvChi;
  3962.         else if (goodType == 6) inv_Country = spiceInvChi;
  3963.         else if (goodType == 7) inv_Country = ironInvChi;
  3964.         else if (goodType == 8) inv_Country = flourInvChi;
  3965.         else if (goodType == 9) inv_Country = dyeInvChi;
  3966.         else if (goodType == 10) inv_Country = leatherInvChi;
  3967.         else if (goodType == 11) inv_Country = furInvChi;
  3968.         else if (goodType == 12) inv_Country = beerInvChi;
  3969.         else if (goodType == 13) inv_Country = saltInvChi;
  3970.         else if (goodType == 14) inv_Country = wineInvChi;
  3971.     }
  3972.  
  3973.     }
  3974.  
  3975. void eventsNumbers(void)
  3976. {
  3977.     srand(time(0));
  3978.     int randomEvent;
  3979.     if (turn<=10)
  3980.     {randomEvent=rand()%10+1;
  3981.     events(randomEvent);}
  3982.     else if (turn>=11&&turn<=20)
  3983.     {randomEvent=rand()%20+1;
  3984.     events(randomEvent);}
  3985.     else if (turn>=21&&turn<=30)
  3986.     {randomEvent=rand()%30+1;
  3987.     events(randomEvent);}
  3988.     else if (turn>=31&&turn<=40)
  3989.     {randomEvent=rand()%40+1;
  3990.     events(randomEvent);}
  3991.     else if (turn>=41&&turn<=50)
  3992.     {randomEvent=rand()%50+1;
  3993.     events(randomEvent);}
  3994. }
  3995.  
  3996. void events(int random)
  3997. {
  3998.     int x;
  3999.     switch (random){
  4000.         case 1:
  4001.             cout<<"The company thought that you were incompetent, so they see fit that you would lose Eur 2000! Skip a turn and lose Eur 2000."<<endl;
  4002.  
  4003.             if(GOOJcard>=1)
  4004.             {
  4005.                 cout << "Turns out you have that get out of jail card . . . ";
  4006. cout << endl << "You can only get so lucky." << endl;
  4007.                 GOOJcard--;
  4008.             }
  4009.             else
  4010.             {
  4011.             turn++;
  4012.             balance=balance-2000;
  4013.             }
  4014.             break;
  4015.         case 3:
  4016.             cout<<"Psst! Someone just handed you a lucky card!"<<endl;
  4017.             GOOJcard=1;
  4018.             break;
  4019.         case 5:
  4020.             cout<<"The company's stocks gambit paid off! Your company saw fit to give you extra money for trading goods. Receive Eur 1000."<<endl;
  4021.             balance=balance+1000;
  4022.             break;
  4023.         case 7:
  4024.             cout<<"The company thought that your performance was astounding. Receive Eur 500 for trading."<<endl;
  4025.             balance=balance+500;
  4026.             break;
  4027.         case 9:
  4028.             cout<<"Your company wants to use the money from trading for other assets. Lose Eur 1500."<<endl;
  4029.             balance=balance-1500;
  4030.             break;
  4031.         case 11:
  4032.             cout<<"It's tax season! Lose a percentage of your trading balance based on the number of goods in Inventory."<<endl;
  4033.             balance=balance-(potInv*160*0.075+oilInv*400*0.075);
  4034.             break;
  4035.         case 13:
  4036.             cout<<"You go to jail! Skip a turn and lose Eur 2000."<<endl;
  4037.             if(GOOJcard>=1)
  4038.             {
  4039.                 cout<<"Turns out you have that get out of jail card . . . .” << endl << “You can only get so lucky."<<endl;
  4040.                 GOOJcard--;
  4041.             }
  4042.             else
  4043.             {
  4044.             turn++;
  4045.             balance=balance-2000;
  4046.             }
  4047.             break;
  4048.         case 15:
  4049.             cout<<"The company uses your trading balance to pay its debt. Lose half of your trading balance."<<endl;
  4050.             balance=balance/2;
  4051.             break;
  4052.         case 17:
  4053.             cout<<"The company's data was attacked by encryption virus. You lose half of your trading money to pay for ransomware."<<endl;
  4054.             balance=balance/2;
  4055.             break;
  4056.         case 19:
  4057.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  4058.             balance=balance-1000;
  4059.             investment++;
  4060.             break;
  4061.         case 21:
  4062.             cout<<"One of the cargo ships got lost in the transit! Lose Eur 7000."<<endl;
  4063.             balance-=7000;
  4064.             break;
  4065.         case 23:
  4066.             cout<<"You go to jail! Skip a turn and lose Eur 2000."<<endl;
  4067.             if(GOOJcard>=1)
  4068.             {
  4069.                 cout<<"Turns out you have that get out of jail card . . . ." << endl << "You can only get so lucky." <<endl;
  4070.                 GOOJcard--;
  4071.             }
  4072.             else
  4073.             {
  4074.             turn++;
  4075.             balance=balance-2000;
  4076.             }
  4077.             break;
  4078.  
  4079.         case 25:
  4080.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  4081.             balance=balance-1000;
  4082.             investment++;
  4083.             break;
  4084.         case 27:
  4085.             if(investment>=4)
  4086.             {
  4087.                 cout<<"The company's investment paid off! Receive Eur 10000."<<endl;
  4088.                 balance+=10000;
  4089.             }
  4090.             else
  4091.             {
  4092.                 cout<<"The company's investment failed. Along with the few assets you gave them! Lose Eur 2000."<<endl;
  4093.                 balance-=2000;
  4094.             }
  4095.             break;
  4096.         case 29:
  4097.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose Eur 5000."<<endl;
  4098.             balance-=5000;
  4099. break;
  4100.         case 31:
  4101.             cout<<"The stakes are getting higher, you need more money. Receive 50% added more trading money."<<endl;
  4102.             balance=balance*1.5;
  4103. break;
  4104.         case 33:
  4105.             cout<<"Enemy corporations manufactured scandals about your company. Fighting lawsuit after lawsuit is tiring, as well as expensive. Skip 2 turns and lose Eur 8000."<<endl;
  4106.             if(GOOJcard>=1)
  4107.             {
  4108.                 cout<<"Fortunately however, you have that mysterious lucky card that man gave you. It vanished, as well as somehow the problems that plagued you."<<endl;
  4109.                 GOOJcard--;
  4110.             }
  4111.             else
  4112.             {
  4113.             turn++;
  4114.             balance=balance-2000;
  4115.             }
  4116. break;
  4117.         case 35:
  4118.             if (event35==0)
  4119.             {
  4120.                 cout<<"A man approached you, and said, 'I am part of an organization named Cauldron. We would like your sponsorship in order to progress our plans with saving Mother Earth.' What do you do? (1 Yes/2 No)"<<endl;
  4121.                 do {
  4122.                     cout << "Enter Input: ";
  4123.                     cin >> input;
  4124.                     stringstream(input) >> x;
  4125.                     switch (x){
  4126.                         case 1:
  4127.                             cout<<"Thank you for your patronage. We will not forget this.";
  4128.                             Cauldron++;
  4129.                             break;
  4130.                         case 2:
  4131.                             cout<<"I see . . . I hope you don't regret your decision.";
  4132.                             break;
  4133.                         default:
  4134.                             cout<<"Invalid input. Please try again.";
  4135.                             break;
  4136.                             }
  4137.                     break;
  4138.                 } while (input != "1" || input != "2");
  4139.                 event35=1;
  4140.             }
  4141.             else
  4142.             {
  4143.                 cout<<"A strange wind flows today. Had something changed?";
  4144.                 break;
  4145.             }
  4146. break;
  4147.         case 37:
  4148.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  4149.             balance=balance-1000;
  4150.             investment++;
  4151.             break;
  4152.         case 39:
  4153.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose €5000."<<endl;
  4154.             balance-=5000;
  4155. break;
  4156.         case 41:
  4157.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose €5000."<<endl;
  4158.             balance-=5000;
  4159.         case 43:
  4160.             cout<<"You invested in a certain stock. Something may come out of this . . . Lose Eur 1000."<<endl;
  4161.             balance=balance-1000;
  4162.             investment++;
  4163.             break;
  4164.         case 45:
  4165.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose Eur 5000."<<endl;
  4166.             balance-=5000;
  4167.         case 47:
  4168.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  4169.             balance=balance-1000;
  4170.             investment++;
  4171.             break;
  4172.         case 49:
  4173.             if(Cauldron==1)
  4174.             {
  4175.                 cout<<"All of a sudden, the company’s profits soared! Your money is doubled.";
  4176.                 balance=balance*2;
  4177.             }
  4178.             else
  4179.             {
  4180.                 cout<<"All of a sudden, natural disasters began to strike at your holdings! Your money is quartered.";
  4181.                 balance=balance/4;
  4182.             }
  4183.             break;
  4184.         default:
  4185.             cout << "No significant events have occurred!"<<endl;
  4186.             break;
  4187.     }
  4188. }
  4189.  
  4190. // Banking System
  4191. //The Bank Function
  4192. void theBank(void){
  4193.     checkers = 1;
  4194.     string input;
  4195.     memBank = 0;
  4196.     balance_balance();
  4197.     cout << endl;
  4198.     for (int i = 0; i > 15; i++){
  4199.         cout << " ";
  4200.     }
  4201.     cout << endl;
  4202.     cout << setw(37);
  4203.     cout << "Welcome to Jasper's Bank!";
  4204.     cout << endl;
  4205.     for (int i = 0; i > 15; i++){
  4206.         cout << " ";
  4207.     }
  4208.     cout << endl;
  4209.     cout << setw(37);
  4210.     cout << "What do you wish to do?";
  4211.     cout << endl;
  4212.     cout << "             =============================================================================";
  4213.     cout << endl;
  4214.     cout << setw(18);
  4215.     cout << "[1] " << setw(17) << "Withdraw";
  4216.     cout << endl;
  4217.     cout << setw(18);
  4218.     cout << "[2] " << setw(17) << "Deposit";
  4219.     cout << endl;
  4220.     cout << setw(18);
  4221.     cout << "[3] " << setw(17) << "Loan";
  4222.     cout << endl;
  4223.     cout << setw(18);
  4224.     cout << "[4] " << setw(17) << "Check Debt";
  4225.     cout << endl;
  4226.     cout << setw(18);
  4227.     cout << "[5] " << setw(17) << "Deposit Report";
  4228.     cout << endl;
  4229.     cout << setw(18);
  4230.     cout << "[6] " << setw(17) << "Rules";
  4231.     cout << endl;
  4232.     cout << setw(18);
  4233.     cout << "[7] " << setw(17) << "Return";
  4234.     cout << endl;
  4235.     cout << "             =============================================================================";
  4236.     cout << endl;
  4237.     cout << setw(27);
  4238.     do {
  4239.     cout << "Enter Input: ";
  4240.     cin >> input;
  4241.     if (input == "1"){
  4242.         withdraw();
  4243.     }
  4244.     else if (input == "2"){
  4245.         deposit();
  4246.     }
  4247.     else if (input == "3"){
  4248.         loan();
  4249.     }
  4250.     else if (input == "4"){
  4251.         checkDebt();
  4252.     }
  4253.     else if (input == "5"){
  4254.         reports();
  4255.     }
  4256.     else if (input == "6"){
  4257.         rules();
  4258.     }
  4259.     else if (input == "7"){
  4260.         loc();
  4261.     }
  4262.     else cout<<"Invalid input. Please try again."<<endl;
  4263.     } while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "4"|| input != "4"|| input != "7");
  4264. }
  4265.  
  4266. // User Debt Function
  4267. void userDebt(void){
  4268.     if (loanTurn > 0){
  4269.         float A, P, r, n, t;
  4270.         int convert;
  4271.         r = 0.05;
  4272.         t = 1;
  4273.         n = 4;
  4274.         P = loan1;
  4275.         A = P * (pow(1 + (r / n), (n * t)));
  4276.         convert = A;
  4277.         loan1 = convert;
  4278.     }
  4279.     //loanTurn = 4 (Start)
  4280.     if (loanTurn < 0){
  4281.         loanTurn = 0;
  4282.     }
  4283.     else if (loanTurn == 0) loanTurn = 0;
  4284.     else if (loanTurn <= 4){
  4285.         loanTurn--;
  4286.         if (loanTurn == 0){
  4287.             cout << endl;
  4288.             cout << endl;
  4289.             cout << "You were not able to pay your loan.";
  4290.             cout << endl;
  4291.             cout << "Defaulting Loan . . . ";
  4292.             sleep(2);
  4293.             cout << endl;
  4294.             sleep(3);
  4295.             cout << "Adding penalties . . . ";
  4296.             cout << endl;
  4297.             sleep(3);
  4298.             cout << "Adding collection charges . . . ";
  4299.             cout << endl;
  4300.             sleep(3);
  4301.             cout << "Garnishing Balance . . . ";
  4302.             cout << endl;
  4303.             float charge = loan1 * 0.25;
  4304.             balance -= (loan1 + charge);
  4305.             loan1 = 0;
  4306.             loanTurn = 0;
  4307.             cout << endl;
  4308.             cout << "Updated Balance: Eur " << balance;
  4309.             cout << endl;
  4310.             cout << endl;
  4311.             system("pause");
  4312.         }
  4313.     }
  4314. }
  4315.  
  4316. // Withdraw Function
  4317. void withdraw(void){
  4318.     float wd;
  4319.     balance_balance();
  4320.     cout << endl;
  4321.     cout << setw(40);
  4322.     cout << "\t\tHow much money do you wish to withdraw?";
  4323.     cout << endl;
  4324.     cout << "\t\tEnter Input: Eur ";
  4325.     cin >> wd;
  4326.     if (wd < 0){
  4327.         cout << endl;
  4328.         cout << "\t\tInvalid input. Please try again!";
  4329.         cout << endl;
  4330.         system("pause");
  4331.         withdraw();
  4332.     }
  4333.     else if (wd > bankMoney){
  4334.        
  4335.         if (memDp2 == 1){
  4336.             cout << endl;
  4337.             cout << "You've just recently deposited Eur " << bankMoney2 << ".";
  4338.             cout << endl;
  4339.             cout << "Please wait for another turn.";
  4340.             cout << endl;
  4341.             cout << endl;
  4342.             sleep(2);
  4343.             system("pause");
  4344.             theBank();
  4345.         }
  4346.        
  4347.         cout << endl;
  4348.         cout << "\t\tYou do not have that amount in your bank account . . . ";
  4349.         cout << endl;
  4350.         system("pause");
  4351.         withdraw();
  4352.     }
  4353.     else if (wd == 0){
  4354.         cout << endl;
  4355.         cout << "\t\tYou withdrew nothing . . . ";
  4356.         cout << endl;
  4357.         system("pause");
  4358.         theBank();
  4359.     }
  4360.     else if (wd <= bankMoney){
  4361.        
  4362.         if (memDp2 == 1){
  4363.             cout << endl;
  4364.             cout << "You've just recently deposited Eur " << bankMoney2 << ".";
  4365.             cout << endl;
  4366.             cout << "Please wait for another turn.";
  4367.             cout << endl;
  4368.             sleep(2);
  4369.             system("pause");
  4370.             theBank();
  4371.         }
  4372.         cout << endl;
  4373.         cout << "You withdrew Eur " << wd << " to your balance . . . ";
  4374.         cout << endl;
  4375.         cout << "Withdrawal Fee: Eur 3.50";
  4376.         cout << endl;
  4377.         cout << "Your balance has been updated . . . ";
  4378.         balance += wd;
  4379.         bankMoney -= wd;
  4380.         balance -= 3.50;
  4381.         if (bankMoney == 0){
  4382.             memDp = 0;
  4383.         }
  4384.         system("pause");
  4385.         theBank();
  4386.     }
  4387. }
  4388.  
  4389. // Deposit Function
  4390. void deposit(void){
  4391.     balance_balance();
  4392.     float dp;
  4393.     cout << endl;
  4394.     cout << "\t\tHow much money do you wish to deposit?";
  4395.     cout << endl;
  4396.     cout << setprecision(2) << fixed;
  4397.     cout << "\t\tInterest: " << interest2 << "%"; // Note: Please replace this with a randomizer percentage between 5 to 10.8 percent. Thanks.
  4398.     cout << endl;
  4399.     cout << "\t\tEnter Input: Eur ";
  4400.     cin >> dp;
  4401.     if (dp < 0){
  4402.         cout << endl;
  4403.         cout << "\t\tnvalid input. Please try again . . . ";
  4404.         cout << endl;
  4405.         system("pause");
  4406.         deposit();
  4407.        
  4408.     }
  4409.     else if (dp == 0){
  4410.         cout << endl;
  4411.         cout << "\t\tYou deposited nothing . . . ";
  4412.         cout << endl;
  4413.         system("pause");
  4414.         theBank();
  4415.     }
  4416.     else if (dp > balance){
  4417.         cout << endl;
  4418.         cout << "\t\tYou do not have that amount of money in your balance . . . ";
  4419.         cout << endl;
  4420.         system("pause");
  4421.         deposit();
  4422.     }
  4423.     else if (dp <= balance){
  4424.         if (dp <= balance && dp >= balance * 0.9){
  4425.             cout << endl;
  4426.             cout << "\t\tYou are not allowed to input 90% of your balance.";
  4427.             cout << endl;
  4428.             system("pause");
  4429.             deposit();
  4430.         }
  4431.         cout << endl;
  4432.         cout << "\t\tYou deposited Eur " << dp << " to your bank account . . . ";
  4433.         cout << endl;
  4434.         cout << "\t\tYour balance has been updated . . . ";
  4435.         cout << endl;
  4436.         if (memDp2 == 0){
  4437.             lastDeposit = bankMoney;
  4438.             lastDeposit2 = lastDeposit;
  4439.             bankMoney2 = dp;
  4440.         }
  4441.         else if (memDp2 == 1){
  4442.             lastDeposit = bankMoney;
  4443.             lastDeposit2 = lastDeposit;
  4444.             bankMoney2 = dp;
  4445.         }
  4446.         memDp = 1;
  4447.         memDp2 = 1;
  4448.         balance -= dp;
  4449.         bankMoney += dp;
  4450.         system("pause");
  4451.         theBank();
  4452.     }
  4453. }
  4454.  
  4455. // Loan Function
  4456. void loan(void){
  4457.     int sw;
  4458.     memBank = 1;
  4459.     string input;
  4460.     balance_balance();
  4461.     cout << endl;
  4462.     cout << "\t\tYou chose loan . . . ";
  4463.     cout << endl;
  4464.     cout << endl;
  4465.     cout << "\t\tWhat do you wish to do?";
  4466.     cout << endl;
  4467.     cout << "\t\t[1] " << "Repay";
  4468.     cout << endl;
  4469.     cout << "\t\t[2] " << "Borrow";
  4470.     cout << endl;
  4471.     cout << "\t\t[3] " << "Check Debt";
  4472.     cout << endl;
  4473.     cout << "\t\t[4] " << "Return";
  4474.     cout << endl;
  4475.     cout << endl;
  4476.     do {
  4477.     cout << "\t\tEnter Input: ";
  4478.     cin >> input;
  4479.     stringstream(input)>>sw;
  4480.     switch (sw){
  4481.         case 1: repay();
  4482.         break;
  4483.         case 2:
  4484.             if (loan1 > 0){
  4485.              cout << endl;
  4486.              cout << "\t\tYou already have a loan. Please repay your debt . . . ";
  4487.              cout << endl;
  4488.              cout << "\t\tDebt: Eur " << loan1;
  4489.              cout << endl;
  4490.              system("pause");
  4491.              loan();
  4492.  
  4493.         }
  4494.         else{ borrow();
  4495.         break;}
  4496.         case 3: checkDebt();
  4497.         break;
  4498.         case 4: theBank();
  4499.         break;
  4500.         default:
  4501.             cout << endl;
  4502.             cout << "\t\tInvalid input. Please try again.";
  4503.             cout << endl;
  4504.             }
  4505.  
  4506.     } while (input != "1" || input != "2"|| input != "3"|| input != "4");
  4507. }
  4508.  
  4509. // Repay
  4510. void repay(void){
  4511.     if (loan1 <= 0){
  4512.         cout << endl;
  4513.         cout << endl;
  4514.         cout << "You cannot repay anything if you borrowed nothing.";
  4515.         cout << endl;
  4516.         cout << endl;
  4517.         loan();
  4518.     }
  4519.     balance_balance();
  4520.     float repay2 = 0;
  4521.     cout << endl;
  4522.     cout << "\t\tHow much money do you want to repay?";
  4523.     cout << endl;
  4524.     cout << "\t\tEnter Input: Eur ";
  4525.     cin >> repay2;
  4526.     if (loan1 > 0){
  4527.         if (repay2 == 0){
  4528.             cout << endl;
  4529.             cout << endl;
  4530.             cout << "\t\tYou repaid nothing.";
  4531.             cout << endl;
  4532.             cout << endl;
  4533.             system("pause");
  4534.             loan();
  4535.         }
  4536.         else if (repay2 < 0){
  4537.             cout << endl;
  4538.             cout << endl;
  4539.             cout << "\t\tInvalid input. Please try again.";
  4540.             cout << endl;
  4541.             cout << endl;
  4542.             repay();
  4543.         }
  4544.         else if (repay2 <= loan1 + 0.09){
  4545.             cout << endl;
  4546.             cout << endl;
  4547.             if (loanTurn == 4){
  4548.                 float repay3;
  4549.                 cout << endl;
  4550.                 cout << "You paid the loan too early. " << interest2 << "% repayment penalty.";
  4551.                 loan1 -= repay2;
  4552.                 repay3 = repay2 * interest2/100;
  4553.                 loan2 = loan1;
  4554.                 balance -= (repay2 + repay3);
  4555.                 cout << endl;
  4556.                 if(loan1 == 0){
  4557.                     memLoan = 0;
  4558.                 }
  4559.                 else if (loan1 <= 0.009) loan1= 0;
  4560.                 cout << endl;
  4561.                 system("pause");
  4562.                 cout << endl;
  4563.                 loan();
  4564.             }
  4565.             else if (loanTurn < 4){
  4566.                 cout << endl;
  4567.                 cout << "\t\tYou have chosen to repay Eur " << loan1 << " by " << repay2 << ".";
  4568.                 cout << endl;
  4569.                 loan1 -= repay2;
  4570.                 balance -= repay2;
  4571.                 if(loan1 == 0){
  4572.                     memLoan = 0;
  4573.                     loanTurn = -1;
  4574.                 }
  4575.                 else if (loan1 <= 0.009) loan1= 0;
  4576.                 system("pause");
  4577.                 loan();
  4578.             }
  4579.         }
  4580.     }
  4581. }
  4582. // Borrow
  4583. void borrow(void){
  4584.     balance_balance();
  4585.     int borrow_ = 0;
  4586.     cout << endl;
  4587.     cout << "\t\tHow much money do you want to borrow?";
  4588.     cout << endl;
  4589.     cout << "\t\tEnter Input: Eur ";
  4590.     cin >> borrow2;
  4591.     if (borrow2 < 0){
  4592.         cout << endl;
  4593.         cout << "\t\tInvalid input. Please try again.";
  4594.         cout << endl;
  4595.         system("pause");
  4596.         borrow();
  4597.     }
  4598.     else if (borrow2 == 0){
  4599.         cout << endl;
  4600.         cout << "\t\tYou borrowed nothing . . . ";
  4601.         cout << endl;
  4602.         system("pause");
  4603.         loan();
  4604.     }
  4605.     else if (borrow2 < 1000){
  4606.         cout << endl;
  4607.         cout << "\t\tOnly Eur 1,000 and above will be allowed as an input.";
  4608.         cout << endl;
  4609.         system("pause");
  4610.         borrow();
  4611.     }
  4612.     else if (borrow2 <= 1100000){
  4613.         //Eur 5000
  4614.         if (balance < 5000){
  4615.             if (borrow2 > 20000){
  4616.                 cout << endl;
  4617.                 trust(); cout << "20000.";
  4618.                 cout << endl;
  4619.                 cout << endl;
  4620.                 system("pause");
  4621.                 borrow();
  4622.             }
  4623.             else{
  4624.                 trusted();
  4625.             }
  4626.         }
  4627.         //Eur 10000
  4628.         else if (balance < 10000){
  4629.             if (borrow2 > 40000){
  4630.                 cout << endl;
  4631.                 trust(); cout << "40,000.";
  4632.                 cout << endl;
  4633.                 system("pause");
  4634.                 borrow();
  4635.             }
  4636.             else{
  4637.                 trusted();
  4638.             }
  4639.         }
  4640.         else if (balance < 20000){
  4641.             if (borrow2 > 120000){
  4642.                 cout << endl;
  4643.                 trust(); cout << "120,000.";
  4644.                 cout << endl;
  4645.                 system("pause");
  4646.                 borrow();
  4647.             }
  4648.             else{
  4649.                 trusted();
  4650.             }
  4651.         }
  4652.         else if (balance < 120000){
  4653.             if (borrow2 > 400000){
  4654.                 cout << endl;
  4655.                 trust(); cout << "400,000.";
  4656.                 cout << endl;
  4657.                 system("pause");
  4658.                 borrow();
  4659.             }
  4660.             else{
  4661.                 trusted();
  4662.             }
  4663.         }
  4664.         else if (balance < 400000){
  4665.             if (borrow2 > 1100000){
  4666.                 cout << endl;
  4667.                 cout << "Jasper's Bank is only allowed to loan 15% of its legal capital . . . ";
  4668.                 cout << endl;
  4669.                 cout << "Please choose a value that is less than or equal to Eur 1,100,000";
  4670.                 cout << endl;
  4671.                 system("pause");
  4672.                 borrow();
  4673.             }
  4674.             else{
  4675.                 trusted();
  4676.             }
  4677.         }
  4678.     }
  4679.     else {
  4680.         cout << endl;
  4681.         cout << "Jasper's Bank is only allowed to loan 15% of its legal capital . . . ";
  4682.         cout << endl;
  4683.         cout << "Please choose a value that is less than or equal to Eur 1,100,000";
  4684.         cout << endl;
  4685.         system("pause");
  4686.         borrow();
  4687.     }
  4688. }
  4689.  
  4690. void compoundBank(void){
  4691.     float A, P, r, n, t;
  4692.     /*
  4693.     A - Final Amount
  4694.     P - Initial Principal Balance
  4695.     r - Interest Rate
  4696.     n - Number of Times Interest Applied per Turn Period
  4697.     t - Number of 4-Turns
  4698.     1 turn = 4 months
  4699.     3 turns = 12 months
  4700.     */
  4701.     r = 0.03;
  4702.     t = 1;
  4703.     n = 1;
  4704.     P = bankMoney;
  4705.     A = P * (pow((1 + (r / n)), (n * t)));
  4706.     A -= bankMoney;
  4707.     bankMoney += A;
  4708. }
  4709.  
  4710. void trust(void){
  4711.     cout << endl;
  4712.     cout << "Jasper's Bank doesn't trust you to repay your loan.";
  4713.     cout << endl;
  4714.     cout << "Please input a value less than or equal to Eur ";
  4715. }
  4716.  
  4717. void trusted(void){
  4718.     cout << endl;
  4719.     cout << "You borrowed Eur " << borrow2 << " from Jasper's Bank with " << interest << "% compound interest.";
  4720.     loan1 += borrow2;
  4721.     balance += borrow2;
  4722.     loan2 = loan1;
  4723.     cout << endl;
  4724.     system("pause");
  4725.     memLoan = 1;
  4726.     loanTurn = 4;
  4727.     loan();
  4728. }
  4729.  
  4730. void checkDebt(void){
  4731.     cout << endl;
  4732.     cout << "\t\tDebt: Eur " << loan1;
  4733.     cout << endl;
  4734.     system("pause");
  4735.     if (memBank == 0){
  4736.         theBank();
  4737.     }
  4738.     else if (memBank == 1){
  4739.         loan();
  4740.     }
  4741. }
  4742.  
  4743. void rules(void){
  4744.     cout << endl;
  4745.     cout << endl;
  4746.     cout << "              Rules";
  4747.     cout << endl;
  4748.     cout << "             =============================================================================";
  4749.     cout << endl;
  4750.     cout << "              Every turn is equal to four months.";
  4751.     cout << endl;
  4752.     cout << "              Every three turns is equal to one year.";
  4753.     cout << endl;
  4754.     cout << "              Every turn your loan debt increases.";
  4755.     cout << endl;
  4756.     cout << "              If you have not paid in the fourth turn your balance will be garnished.";
  4757.     cout << endl;
  4758.     cout << "              There is a penalty for not paying your debt.";
  4759.     cout << endl;
  4760.     cout << "             =============================================================================";
  4761.     cout << endl;
  4762.     cout << endl;
  4763.     system("pause");
  4764.     theBank();
  4765. }
  4766.  
  4767. void reports(void){
  4768.     if (memDp == -1){
  4769.         cout << endl;
  4770.         cout << endl;
  4771.         cout << "You have not deposited any money yet.";
  4772.         cout << endl;
  4773.         cout << endl;
  4774.         system("pause");
  4775.         theBank();
  4776.     }
  4777.     else if (memDp == 0){
  4778.         cout << endl;
  4779.         cout << endl;
  4780.         cout << "********** Financial Report **********";
  4781.         cout << endl;
  4782.         cout << "********** Jasper's Bank ***********";
  4783.         cout << endl;
  4784.         lastDeposit = bankMoney;
  4785.         cout << "Current Deposit: Eur " << bankMoney;
  4786.         cout << endl;
  4787.         cout << "Last Deposit: Eur " << lastDeposit;
  4788.         cout << endl;
  4789.         cout << "Increased by: " << (lastDeposit2 / lastDeposit) * 100 << "%.";
  4790.         cout << endl;
  4791.         cout << "********** End of Report **********";
  4792.         cout << endl;
  4793.         cout << endl;
  4794.         system("pause");
  4795.         theBank();
  4796.     }
  4797.     else if (memDp == 1){
  4798.         cout << endl;
  4799.         cout << endl;
  4800.         cout << "********** Financial Report **********";
  4801.         cout << endl;
  4802.         cout << "************ Jasper's Bank ***********";
  4803.         cout << endl;
  4804.         lastDeposit = bankMoney;
  4805.         cout << "        Current Deposit: Eur " << lastDeposit;
  4806.         cout << endl;
  4807.         //cout << "        Increased by: " << (lastDeposit2 / lastDeposit) * 100 << "%.";
  4808.         cout << endl;
  4809.         cout << "************* End of Report **********";
  4810.         cout << endl;
  4811.         cout << endl;
  4812.         system("pause");
  4813.         theBank();
  4814.     }
  4815. }
  4816.  
  4817. void taxes(void){ // Based on Germany
  4818.     //taxed at the fourth turn
  4819.     taxStore = balance;
  4820.     taxStore -= loan1;
  4821.     taxStore2 = 0;
  4822.     taxStore3 = 0;
  4823.     taxStore4 = 0;
  4824.     if(taxStore <= 9000){
  4825.         taxStore *= 0;
  4826.         cout << endl;
  4827.         cout << endl;
  4828.         cout << "Fourth Turn: You paid no taxes as your balance is too low . . . ";
  4829.         cout << endl;
  4830.         cout << endl;
  4831.     }
  4832.     else if (taxStore > 9000){
  4833.         if (taxStore >= 9001 && balance <= 13996){
  4834.             taxStore2 = taxStore;
  4835.             taxStore2 = taxStore2 - 9000;
  4836.             taxStore3 = taxStore2 * 0.15;
  4837.             taxStore2 = taxStore2 - taxStore3;
  4838.             cout << endl;
  4839.             cout << endl;
  4840.             cout << "Fourth Turn: You paid Eur " << taxStore2 << " on taxes . . . ";
  4841.             cout << endl;
  4842.             cout << endl;
  4843.             balance -= taxStore2;
  4844.         }
  4845.         else if (taxStore >= 13997 && taxStore <= 54949){
  4846.             taxStore2 = taxStore;
  4847.             taxStore2 = taxStore2 - 13996;
  4848.             taxStore3 = taxStore2 * 0.2397;
  4849.             taxStore4 = taxStore2 - taxStore3;
  4850.             taxStore2 = taxStore3;
  4851.             firstBracket();
  4852.             cout << endl;
  4853.             cout << endl;
  4854.             cout << "Fourth Turn: You paid Eur " << taxStore2 << " on taxes . . . ";
  4855.             cout << endl;
  4856.             cout << endl;
  4857.             balance -= taxStore2;
  4858.         }
  4859.         else if (taxStore >= 54950 && taxStore <= 260532){
  4860.             taxStore2 = taxStore;
  4861.             taxStore2 = taxStore2 - 54949;
  4862.             taxStore3 = taxStore2 * 0.42;
  4863.             taxStore4 = taxStore2 - taxStore3;
  4864.             taxStore2 = taxStore3;
  4865.             secondBracket();
  4866.             firstBracket();
  4867.             cout << endl;
  4868.             cout << endl;
  4869.             cout << "Fourth Turn: You paid Eur " << taxStore2 << " on taxes . . . ";
  4870.             cout << endl;
  4871.             cout << endl;
  4872.             balance -= taxStore2;
  4873.         }
  4874.         else if (taxStore >= 260533){
  4875.             taxStore2 = taxStore;
  4876.             taxStore2 = taxStore2 - 260532;
  4877.             taxStore3 = taxStore2 * 0.45;
  4878.             taxStore4 = taxStore2 - taxStore3;
  4879.             taxStore2 = taxStore3;
  4880.             thirdBracket();
  4881.             secondBracket();
  4882.             firstBracket();
  4883.             cout << endl;
  4884.             cout << endl;
  4885.             cout << "Fourth Turn: You paid Eur " << taxStore2 << " on taxes . . . ";
  4886.             cout << endl;
  4887.             cout << endl;
  4888.             balance -= taxStore2;
  4889.         }
  4890.     }
  4891. }
  4892.  
  4893. void firstBracket(void){
  4894.     float taxStore5 = 0;
  4895.     taxStore5 += (13996 * 0.15);
  4896.     taxStore2 = taxStore2 + taxStore5;
  4897. }
  4898.  
  4899. void secondBracket(void){
  4900.     float taxStore5 = 0;
  4901.     taxStore5 += (54949 * 0.2397);
  4902.     taxStore2 = taxStore2 + taxStore5;
  4903. }
  4904.  
  4905. void thirdBracket(void){
  4906.     float taxStore5 = 0;
  4907.     taxStore5 += (260532 * 0.42);
  4908.     taxStore2 = taxStore2 + taxStore5;
  4909. }
  4910.  
  4911. void fourthBracket(void){
  4912.     float taxStore5 = 0;
  4913.     taxStore5 += (balance * 0.45);
  4914.     taxStore2 = taxStore2 + taxStore5;
  4915. }
  4916.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement