I want to make a registration program. So there is 5 enrollments possbiel, lets say music, English, history, sports, photography. I want to make it so it will ask the user to enter to enroll into only 3 units out of the 5 options listed above. only those 5 are the options, if anything else is entered say like "math" or "jdwhagdwa" then it will ask the user to re enter it. Once the student enters the unit it should tell them the classes they have enrolled into and the fee for each class
import java.util.*;
public class CheckMarkEnroll
{
public void Enroll()
{
Scanner in = new Scanner(System.in);
Scanner sc = new Scanner(System.in);
int i = 0;
String studentlogin = "u123";
//Unit name
String english="Math";
String history="History";
String sports="Sports";
String photography="Photography";
String music="Music";
String musicfee ="$1320";
String englishfee="$1890";
String historyfee="$1890";
String sportsfee="$1600";
String photographyfee="$1500";
String studentId="";
String course1="";
String course2="";
String course3="";
//============================================START OF
PROGRAM==================================================================//
System.out.println("Welcome to student enrollment");
System.out.println("Please enter your student ID");
studentId = in.nextLine();
System.out.println("Please enter name of units you would like to enroll into. You may enroll
into only 4 units. Upon entering please enter if this is your first time or you are
repeating this unit. At the end your fees required will be shown");
System.out.println("List of units available to enroll:");
System.out.println("music");
System.out.println("english");
System.out.println("history");
System.out.println("sports");
System.out.println("photography");
System.out.println("Please enter name of unit #1 : ");
course1= sc.nextLine();
System.out.println("Please enter name of unit #2 : ");
course2= sc.nextLine();
System.out.println("Please enter name of unit #3 : ");
course3= sc.nextLine();
}
}