Assignment"Rewrite the menu chooser program from chapter using an enumerator to represent difficulty levels. the variable choice will still be of type int."

The first set of code is the original menu chooser program in its original untainted form. The second set of code is what I added to it in order to complete the assignment.

The only thing I want to ask is: Did I complete my assignment correctly. If I did it wrong, can someone please explain what I did wrong. I'm very new at this.

Code Set # 1 - Original

#include &lt;iostream&gt;
using namespace std;
int main()
cout &lt;&lt; "Difficulty Levels\n\n";
cout &lt;&lt; "1 - Easy\n";
cout &lt;&lt; "2 - Normal\n";
cout &lt;&lt; "3 - Hard\n";

int choice;
cout &lt;&lt; "Choice: ";
cin &gt;&gt; choice;

switch (choice)
{
    case 1:
            cout &lt;&lt; "You picked Easy.\n";
            break;
    case 2:
            cout &lt;&lt; "You picked Normal.\n";
            break;
    case 3:
            cout &lt;&lt; "You picked Hard.\n";
            break;
    default:
            cout &lt;&lt; "You made an illegal choice.\n";
}

return 0;
}


Code Set # 2 - Assignment

#include &lt;iostream&gt;

using namespace std;

int main()
{
    cout &lt;&lt; "Difficulty Levels\n\n";
    cout &lt;&lt; "0 - Novice\n";
    cout &lt;&lt; "1 - Easy\n";
    cout &lt;&lt; "2 - Normal\n";
    cout &lt;&lt; "3 - Hard\n";
    cout &lt;&lt; "4 - Unbeatable\n\n";

enum {Novice = 0, Easy = 1, Normal = 2, Hard = 3, Unbeatable = 4};

int choice;
cout &lt;&lt; "Choice: ";
cin &gt;&gt; choice;

switch (choice)
{
    case 0:     
            cout &lt;&lt; "You have picked Novice.\n";
            break;
    case 1:
            cout &lt;&lt; "You picked Easy.\n";
            break;
    case 2:
            cout &lt;&lt; "You picked Normal.\n";
            break;
    case 3:
            cout &lt;&lt; "You picked Hard.\n";
            break;
    case 4: 
            cout &lt;&lt; "You picked Unbeatable.\n";
            break;
            default:
            cout &lt;&lt; "You made an illegal choice.\n";
}

return 0;
}



Question: Silverlight: Returning value from synchronous method using Rx
Answer: Remember that GetBookAsync returns immediately, and will return the value stored in returnvalue. When the data arrives returnvalue will be out of scope, and by then btnCreate will have finished.

U could use await on the GetBookAsync, so that it will wait for the data to arrive before continuing.  Don't forget that would mean u also need the async on the method.

Not a great example or use of either RX or await, but trying is how we learn!