#include <iostream>
#include <ctime>
using namespace std;
enum Level {easy=1, hard, medium};
class alpha
{
private:
Level level;
int number;
public:
alpha() : level(easy), number(5)
{}
void gen()
{
srand(time(NULL));
number = rand() % 10 + 1;
int levelgen = rand() % 3 + 1;
switch (levelgen)
{
case 1:
level = easy;
break;
case 2:
level = medium;
case 3:
level = hard;
default:
break;
}
}
void disp()
{
if (level == hard)
cout << "level - ???? " << endl;
else
{
cout << "level = ";
switch (level)
{
case easy:
cout << "easy" << endl;
break;
case medium:
cout << "medium" << endl;
break;
default:
break;
}
}
cout << "number = " << number << endl;
}
};
int main()
{
srand(time(NULL));
alpha obj1;
obj1.gen();
obj1.disp();
alpha obj2;
obj2.gen();
obj1.disp();
system("pause");
}