import java.util.Scanner;
class Majors {
public static void main(String[] args) {
String major;
Scanner in = new Scanner(System.in);
System.out.println("Enter a major: ");
for (majors maj: majors.values())
{
System.out.println(maj);
}
major=in.nextLine();
switch (major){
case "ACC":
case "CIS":
System.out.println("This major falls under the Business division");
break;
case"CHEM":
case"PHYS":
System.out.println("This major falls under the Science division");
break;
case"ENG":
case"HIS":
System.out.println("This major falls under the Humanities division");
break;
default:
System.out.println("This is not a major");
}
}
}
enum majors{ACC, CHEM, CIS, ENG, HIS, PHYS}
Comments
Leave a comment