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 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include <iostream>
#include <string>
using namespace std;
void choice(int listchoice[],int size)
{
cout << "Please select an item number" << endl;
for(int x=0;x<size;x++)
{
cout << listchoice[x] << endl;
}
}
int selection(int number); //function prototype
int main()
{
int listchoiceEdit[24]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24};
choice(listchoiceEdit,24);
int selection,number; //function is called
cin >> selection;
if (selection<1 || selection>24)
{
cout << "make a choice between 1 and 24" << endl;
cin >> selection;
}
else
{
cout << "your choice is " << selection << endl;
}
number = selection;
}
int selection(int number)
{
cout << "your choice is still" << number << endl;
}
item()
{
}
| |