Rachael Oke / Mbed 2 deprecated lab6

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
rachaeloke
Date:
Sun Mar 21 19:58:15 2021 +0000
Commit message:
Display Hello World

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Mar 21 19:58:15 2021 +0000
@@ -0,0 +1,81 @@
+#include <iostream>
+
+using namespace std;
+int DisplayMenuGetChoice();
+void GoblinSickDays();
+void DisplaySomethingCool();
+
+
+int main ()
+{
+    int option;
+    do{
+    
+    option = DisplayMenuGetChoice();
+    switch(option)
+    {
+        case 1:
+        GoblinSickDays();
+        break;
+        case 2:
+        DisplaySomethingCool();
+        break;
+        case 3:
+        return 0;
+        break;
+        default:
+        cout << "invalid option, choose from option 1 - 3" << endl;
+    }
+   
+   
+    }while(option !=3);
+    
+    
+    
+    
+}
+
+int DisplayMenuGetChoice()
+{
+    cout << "1- enter Goblin Sick Days" << endl; 
+    cout << "2- enter Display Something Cool" << endl;
+    cout << "3- enter End The Program" << endl;
+    int option;
+    cin >> option;
+    return option;
+}
+
+void DisplaySomethingCool()
+{
+ cout << "_______  _______  _______           _______  _______  _  " << endl;    
+ cout << "(  ____ )(  ___  )(  ____ \|\     /|(  ___  )(  ____ \( \ " << endl;     
+ cout << "| (    )|| (   ) || (    \/| )   ( || (   ) || (    \/| (  " << endl;      
+ cout << "| (____)|| (___) || |      | (___) || (___) || (__    | |  " << endl;      
+ cout << "|     __)|  ___  || |      |  ___  ||  ___  ||  __)   | |    " << endl;    
+ cout << "| (\ (   | (   ) || |      | (   ) || (   ) || (      | |      " << endl;  
+ cout << "| ) \ \__| )   ( || (____/\| )   ( || )   ( || (____/\| (____/\ " << endl; 
+ cout << "|/   \__/|/     \|(_______/|/     \||/     \|(_______/(_______/ " << endl; 
+                                                 
+}
+
+void GoblinSickDays()
+{
+    int num_tellers = 0;
+    int teller;
+    cout << "How many Goblins worked at Gringotts during each of the last 3 years?" << endl;
+    cin >> teller;
+    
+    for(int i = 0; i < num_tellers; i++)
+    {
+        for(int x = 0; x < 3; x++)
+        {
+        int num;
+        cout << "how many days was Goblin out for during year 1?" << i << " and year " << x << endl;
+        cin >> num;
+        num_tellers += num;
+        }
+    }
+    
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Mar 21 19:58:15 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file