Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- switch (option)
- {
- case 1:
- System.out.println("Please enter your name: ");
- String name = input.next();
- System.out.println("Please select your birth month: ");
- System.out.println("---------");
- System.out.println(" 1) January");
- System.out.println(" 2) February");
- System.out.println(" 3) March");
- System.out.println(" 4) April");
- System.out.println(" 5) May");
- System.out.println(" 6) June");
- System.out.println(" 7) July");
- System.out.println(" 8) August");
- System.out.println(" 9) September");
- System.out.println(" 10) October");
- System.out.println(" 11) November");
- System.out.println(" 12) December");
- System.out.println(" 0) Exit");
- int month = input.nextInt();
- System.out.println("Please enter the day you were born: ");
- int day = input.nextInt();
- System.out.println("Please enter the year you were born: ");
- int year = input.nextInt();
- Calendar cal = new GregorianCalendar(year, month, day);
- System.out.println("Are you male or female?: ");
- System.out.println("---------");
- System.out.println(" 1) Male");
- System.out.println(" 2) Female");
- System.out.println(" 0) Exit");
- int maleOrFemale = input.nextInt();
- boolean male = true;
- if (maleOrFemale == 1){
- male = true;
- }
- if(maleOrFemale == 2){
- male = false;
- }
- System.out.println("Please enter your address: ");
- String address = input.next();
- System.out.println("What field are you in?: ");
- System.out.println("---------");
- System.out.println(" 1) Intern");
- System.out.println(" 2) General");
- System.out.println(" 3) Specialst");
- System.out.println(" 0) Exit");
- int field = input.nextInt();
- int registrationFees = 0;
- if (field == 1){
- System.out.println("Please enter your phone number: ");
- int phoneNumber = input.nextInt();
- registrationFees = 310;
- Doctor intern = new Intern(name, cal, male, address, registrationFees, phoneNumber);
- addDoctor(intern);
- }
- if (field == 2){
- System.out.println("Please enter your phone number: ");
- int phoneNumber = input.nextInt();
- System.out.println("Did you qualify in Ireland y/n?: ");
- String qualifiedInIreland = input.next();
- if (qualifiedInIreland.toLowerCase().equals("y")){
- registrationFees = 194;
- Doctor general = new Intern(name, cal, male, address, registrationFees, phoneNumber);
- addDoctor(general);
- }
- if (qualifiedInIreland.toLowerCase().equals("n")){
- registrationFees = 410;
- Doctor general = new Intern(name, cal, male, address, registrationFees, phoneNumber);
- addDoctor(general);
- }
- else{
- System.out.println("Not valid data!");
- }
- }
- if (field == 3){
- System.out.println("Please enter your phone number: ");
- int phoneNumber = input.nextInt();
- System.out.println("Did you qualify in Ireland y/n?: ");
- String qualifiedInIreland = input.next();
- if (qualifiedInIreland.toLowerCase().equals("y")){
- registrationFees = 425;
- Doctor specialist = new Intern(name, cal, male, address, registrationFees, phoneNumber);
- addDoctor(specialist);
- }
- if (qualifiedInIreland.toLowerCase().equals("n")){
- registrationFees = 641;
- Doctor specialist = new Intern(name, cal, male, address, registrationFees, phoneNumber);
- addDoctor(specialist);
- }
- else{
- System.out.println("Not valid data!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement