In: Computer Science
Have a look at the code below. Write a switch statement to check for the mode type. When the designated mode is matched, display an appropriate string for that mode. The default case should display the statement, “We do not offer this mode of course delivery.”
public class SwitchCourse
{
enum CourseMode { ONLINE, RESIDENTIAL, HYBRID
}
CourseMode myCourse = CourseMode.HYBRID;
public void myCourse()
{
switch (/*___*/)
{
case ONLINE:
System.out.println("You will not need to attend classes on
campus.");
break;
case RESIDENTIAL:
System.out.println("All of your classes will be held on
campus.");
break;
case HYBRID:
System.out.println("You will be required to attend one class a week
on campus.");
break;
/*____*/
/*_____*/
}
}
}
Please find the answer below:-
SwitchCourse.java
Output:-
Thanks.
Hope you like the answer.