Menu

Pages: 12
closed account (48T7M4Gy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Pick a game menu

#include<iostream>
using namespace std;

void playGameA(); // this is a 'protoptype' for the complete function below
void playGameB();

int main ()

{
    //open of main
    int select;

    cout << " Please type in one number : \n\n\t\t1 for GAME A \t\t2 for GAME B"<< endl;
    cin >> select;

    switch (select)
    {
    //open of switch
    case 1:
        cout << "You have selected GAME A " ;
        playGameA();
        break;
    case 2:
        cout << " You have selected GAME B " ;
        playGameB();
        break;
    default:
        cout << "You entered a wrong number" << endl;

    } // end of switch
    return 0;
} //end of main

void playGameA()
{
    cout << "\n One day I'll put game A code here" << endl;
}

void playGameB()
{
    cout << "\n One day I'll put game B code here" << endl;
}


Just filling it out to hopefully add to what Ganado has written.
Topic archived. No new replies allowed.
Pages: 12