From 7b6199a83091eaf6f63cb8ae26dc546c17e8f474 Mon Sep 17 00:00:00 2001 From: Lev Date: Mon, 12 Apr 2021 20:49:17 -0500 Subject: [PATCH] Update fixed menu --- .../Topic 1/1.3.5/a.exe | Bin 58531 -> 58531 bytes .../Topic 1/1.3.5/main.cpp | 95 +++++++++--------- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/CM2005 Object Oriented Programming/Topic 1/1.3.5/a.exe b/CM2005 Object Oriented Programming/Topic 1/1.3.5/a.exe index 1dc7625969ae374373024803d2c1c9f60251024e..b63464b8dbd31f2dba2d1f2dc473bf452a5a7a3b 100644 GIT binary patch delta 236 zcmZ2{l6mn-<_R54)}JSK`7tr2ZM=1h%f0yr8-MHazyJSx^olOlWMJ^<=Dn)J!0=)M z1Bfkp6Ug@HJosWIkh=qj89bVg7{ne9_2_)+(fmfiqnFn_0;sxZ@;7cRA$Abc3#6!* zckBQE|6g32Y{a9vIe{lboY8UfN#*5Ss;|Tu7%CDN7(g_u1Or10kPV_8fp`Lt4Wi>W zPt`l@q56uQfq{`hfq@xlAOk}j3s4~kvPd6L#Bp+Mxil+3P)X$E#Lc3UKa}cieo%fm F2LP+7M-u=5 delta 216 zcmZ2{l6mn-<_R54`ky9t`7ynW-gxU4mvZZYQYDXG(G{8u3?ALQw{#d7UQA^Gu|@9z z*&dw-U#y#ahg*`(CITo^KKVDdmJkn!=?_xW%e(de|Nk#;Pd4Y#WSIa2o8x&h#Tjij zpHyDXrTSEyfuSOSfdND_NH8$80NEhg28bsB*&sS<^HjaV9;#2-85kHD6d0I+Di|2z lSbzivvPd6L#Ab4Bxil*mP)X$E#Lc3UKa}cieo%fm2LQVwKV<*_ diff --git a/CM2005 Object Oriented Programming/Topic 1/1.3.5/main.cpp b/CM2005 Object Oriented Programming/Topic 1/1.3.5/main.cpp index c5af6d2..c7193bc 100644 --- a/CM2005 Object Oriented Programming/Topic 1/1.3.5/main.cpp +++ b/CM2005 Object Oriented Programming/Topic 1/1.3.5/main.cpp @@ -2,60 +2,65 @@ int main(int argc, char const *argv[]) { - // 1 print help - std::cout << "1: Print help" << std::endl; - // 2 print exchange stats - std::cout << "2: Print exchange stats" << std::endl; - // 3 make an offer - std::cout << "3: Make an offer" << std::endl; - // 4 make a bid - std::cout << "4: Make a bid " << std::endl; - // 5 print wallet - std::cout << "5: Print wallet " << std::endl; - // 6 continue - std::cout << "6: Continue" << std::endl; - std::cout << "==========" << std::endl; - std::cout << "Enter an option: " << std::endl; - int userOption; - std::cin >> userOption; - std::cout << "You chose: " << userOption << std::endl; - - if(userOption == 0) // bad input + while(true) { - std::cout << "Invalid choice. Choose 1-6" << std::endl; - } + // 1 print help + std::cout << "1: Print help" << std::endl; + // 2 print exchange stats + std::cout << "2: Print exchange stats" << std::endl; + // 3 make an offer + std::cout << "3: Make an offer" << std::endl; + // 4 make a bid + std::cout << "4: Make a bid " << std::endl; + // 5 print wallet + std::cout << "5: Print wallet " << std::endl; + // 6 continue + std::cout << "6: Continue" << std::endl; - if(userOption == 1) // Option 1 - Help - { - std::cout << "Help - Your aim is to analyze the market, make bid and offers and make money." << std::endl; - } + std::cout << "==========" << std::endl; + std::cout << "Enter an option: " << std::endl; - if(userOption == 2) // Option 2 - Stats - { - std::cout << "Market looks good" << std::endl; - } + int userOption; + std::cin >> userOption; + std::cout << "You chose: " << userOption << std::endl; + + if(userOption == 0) // bad input + { + std::cout << "Invalid choice. Choose 1-6" << std::endl; + } - if(userOption == 3) // Option 3 - Offer - { - std::cout << "Make an offer - Enter the amount: " << std::endl; - } + if(userOption == 1) // Option 1 - Help + { + std::cout << "Help - Your aim is to analyze the market, make bid and offers and make money." << std::endl; + } - if(userOption == 4) // Option 4 - Bid - { - std::cout << "Make a bid - Enter the amount: " << std::endl; - } + if(userOption == 2) // Option 2 - Stats + { + std::cout << "Market looks good" << std::endl; + } - if(userOption == 5) // Option 5 - Wallet - { - std::cout << "Your wallet is empty. " << std::endl; - } + if(userOption == 3) // Option 3 - Offer + { + std::cout << "Make an offer - Enter the amount: " << std::endl; + } - if(userOption == 0) // bad input - { - std::cout << "Going to next time frame. " << std::endl; - } + if(userOption == 4) // Option 4 - Bid + { + std::cout << "Make a bid - Enter the amount: " << std::endl; + } + if(userOption == 5) // Option 5 - Wallet + { + std::cout << "Your wallet is empty. " << std::endl; + } + + if(userOption == 6) // bad input + { + std::cout << "Going to next time frame. " << std::endl; + return 0; + } + } return 0; }