Electrical and Computer Engineering
9 of 12
UAH
CPE 112
Enumeration Type Input
•Enumeration types are known only internally to the program, they are input and output indirectly.
•
•  string animalName;
•  cin >> animalName;
•
•  switch (toupper(animalName[0]))
•  {
•     case ‘R’ : if (toupper(animalName[1] == ‘O’)
•                   inPatient = RODENT;
•                else
•                   inPatient = REPTILE;
•                break;
•     case ‘C’ : inpatient = CAT;
•                break;
•                 .
•                 .
•                 .