I am starting to get used to the use of switch case and enum... Basically, all that I need to learn all the basics of what I need is how I'm supposed to personally record information without having to manually go into the code.
I want to simply type in the information and have it recorded into the appopriate value... instead of simply having it instantly record a pre-made value.
Code:
#include <iostream.h>
using namespace std;
enum athel_names { Ed, Joe, Bill, Dan};
enum class_level { Freshman, Sophomore, Junior, Senior, Drop_Out, Graduate };
enum sport_teams { Football, Basketball, Baseball, None };
enum grade_acept { Yes, No };
struct students
{
athel_names an;
class_level cl;
sport_teams st;
grade_acept ga;
};
int main()
{
students sport;
sport.an = Ed;
sport.cl = Senior;
sport.st = Football;
sport.ga = No;
system("cls");
switch ( sport.an ) {
case Ed:
cout << "Ed\n";
break;
case Joe:
cout << "Joe\n";
break;
case Bill:
cout << "Bill\n";
break;
case Dan:
cout << "Dan\n";
break;
default:
break;
}
system("pause");
}
Basically, this system records the information on 4 people (Either Ed, Joe, Bill, or Dan), which school class they are in (Freshman, Sophomore, Junior, Senior, Drop Out, or Graduate), what sport they would wish to take (Football, Basketball, Baseball, or None), and if their grades are/were acceptable to allow them to take a sport... Not a real life situation, but it works...
The problem isn't in the coding (Though, it may be somewhat inefficiant due to me being a novice), because it works, the problem lies in my need to type in the information... Sort of typing in a normal integer with cin.
Sorry for the lengthy post, and whether or not I get help, thanks for your time! n_n