RPMC-Project/.DS_Store __MACOSX/RPMC-Project/._.DS_Store RPMC-Project/pom.xml XXXXXXXXXX com.mycompany RPMC-Project XXXXXXXXXXSNAPSHOT jar XXXXXXXXXXUTF-8 XXXXXXXXXX XXXXXXXXXX...

1 answer below »
I have a critical report to do for a java program . the java program was done with your help. I have attached the necessary files like images with requirements the source code you need for the report and a sample to have an idea.


RPMC-Project/.DS_Store __MACOSX/RPMC-Project/._.DS_Store RPMC-Project/pom.xml 4.0.0 com.mycompany RPMC-Project 1.0-SNAPSHOT jar UTF-8 15 15 RPMC-Project/src/.DS_Store __MACOSX/RPMC-Project/src/._.DS_Store RPMC-Project/src/test/.DS_Store __MACOSX/RPMC-Project/src/test/._.DS_Store RPMC-Project/src/main/.DS_Store __MACOSX/RPMC-Project/src/main/._.DS_Store RPMC-Project/src/main/java/.DS_Store __MACOSX/RPMC-Project/src/main/java/._.DS_Store RPMC-Project/src/main/java/Doctor.java RPMC-Project/src/main/java/Doctor.java //import of all the classes of the utility package import java.util.*; public class Doctor {     //variable for storing doctor's name     String name;         //Create a HashSet object called timeslot     HashSet timeslots=new HashSet();                 //ArrayList for each patient     ArrayList patients=new ArrayList();         //contructor     public Doctor(String name) {         this.name = name;     }         //class for adding the time given by the user     public void addtime(String timeslot,Patient p){         timeslots.add(timeslot);         patients.add(p);     }         //end class } __MACOSX/RPMC-Project/src/main/java/._Doctor.java RPMC-Project/src/main/java/Main.java RPMC-Project/src/main/java/Main.java //import of all the classes of the input and output package import java.io.*; //import of all the classes of the utility package import java.util.*; public class Main {     //throw IOException for input and output operation     public static void main(String[] args) throws IOException{                          //declaration of BufferedReader         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));                                  //use of arrays for declaring the 4 doctors available.         Doctor doctors[]=new Doctor[4];         doctors[0]=new Doctor("Dr. Daniel Hagan");         doctors[1]=new Doctor("Dr. Bravo Gilbert");         doctors[2]=new Doctor("Dr. Steven Seagal");         doctors[3]=new Doctor("Dr. Igor Dondon");                                  //use of arraylist for registering patients         ArrayList patients=new ArrayList();                                  //start of while loop         while(true){                     //menu with options for the user             System.out.println("    Rotten Park Medical Centre (RPMC)    ");             System.out.println("1.\tBook an appointment.");             System.out.println("2.\tCancel an appointment.");             System.out.println("3.\tView a doctor's schedule.");             System.out.println("4.\tView a patient's appointment.");             System.out.println("5.\tExit");             System.out.println("Please enter an option......");                                      int ch=Integer.parseInt(br.readLine());                                              //use of switch statements for displaying sub-menus or messages for the user input                 switch(ch)             {   //case 1 for booking appointment                 case 1:                                     //variables for storing patient details input                     String FirstName,Surname,DateofBirth,CountryofOrigin,timeslot;                     long telephone; int count=0;                                                                             //enter patient's details by using bufferedreader                     System.out.println("\tBook an appointment");                     System.out.println("Enter First Name: ");                                          FirstName=br.readLine();                     System.out.println("Enter Surname: ");                                          Surname=br.readLine();                     System.out.println("Enter Telephone: ");                                          telephone=Long.parseLong(br.readLine());                     System.out.println("Enter Date of Birth: ");                                          DateofBirth=br.readLine();                     System.out.println("Enter Country of Origin: ");                                          CountryofOrigin=br.readLine();                     System.out.println("Select time slot");                                         timeslot=br.readLine();                      System.out.println("Doctors available at this timeslot are:");                                                                                //use of for-loop for displaying available doctors for a particular timeslot                     for(int i=0;i<7){                                 system.out.println((i+1)+". "+doctors[i].name);=""                                 count++;=""                             }=""                         }=""                     }=""                                         //displaying message for input of 0=""                     if(count="=0)"                         system.out.println("no doctors are available at this timeslot");=""                                         =""                                         //choosing doctor=""                     else{=""                         system.out.println("enter your choice");=""                         int cc="Integer.parseInt(br.readLine());"                                                 =""                                                 //registering patient's  details=""                         patients.add(new patient(firstname,surname,telephone,dateofbirth,countryoforigin,timeslot,doctors[cc-1]));=""                                                 =""                                                 //adding patient booking to the doctor's schedule.=""                         doctors[cc-1].addtime(timeslot,new patient(firstname,surname,telephone,dateofbirth,countryoforigin,timeslot,doctors[cc-1]));=""                         system.out.println("booking succesful");=""                     }=""                     break;=""                                         =""                                      //case 2 for cancelling appointment=""                 case 2:=""                     system.out.println("enter the first name of the patient");=""                     string fname="br.readLine();"                     system.out.println("enter the surname of the patient");=""                     string sname="br.readLine();"                     for(int i="">4 && d_id<1){                         system.out.println("wrong choice");                         break;                     }                                         //viewing patients booked with the particular doctor                     for(patient p : doctors[d_id-1].patients)                         system.out.println(p.timeslot+" : "+p.firstname);                     break;                                                                                  //case 4 shows the patients booking details                 case 4:                     system.out.println("enter the first name of the patient");                     string finame=br.readline();                     system.out.println("enter the surname of the patient");                     string suname=br.readline();                     for(patient p  : patients){                                       //if name and surname of the patient details booked equals to the details given by user, print details.                         if(p.firstname.equalsignorecase(finame) && p.surname.equalsignorecase(suname))                             system.out.println(p);                     }                     break;                                 //case 5 for exiting the program                 case 5:                     system.out.println("thank you");                     system.exit(0);                                                                          //displaying message for wrong input                  default:                     system.out.println("option not available!!!\nplease try again");             }         }     }         //end class } __macosx/rpmc-project/src/main/java/._main.java rpmc-project/src/main/java/patient.java rpmc-project/src/main/java/patient.java public class patient {     //variables for patient details          string firstname;     string surname;     long telephone;     string dob;     string country;     string timeslot;     doctor doctor;                  //constructor     public patient(string firstname, string surname, long telephone,             string dob, string country, string timeslot, doctor doctor) {                          //parse the variables into constructor and reverse         super();         firstname = firstname;         surname = surname;         telephone = telephone;         dob = dob;         this.country = country;         this.timeslot = timeslot;         this.doctor = doctor;     }         //this method overrides super-class / implements super-class's methods     @override     public string tostring() {         return "patient details:\n" +         "firstname: " + firstname +          "\nsurname: " + surname +         "\ntelephone: " + string.valueof(telephone) +          "\ndate of birth: " + dob +          "\ncountry of origin: "+ country +          "\ntime of the appointment: " + timeslot +          "\ndoctor registered: " + doctor.name;     }         //end class } rpmc-project/src/main/java/com/.ds_store __macosx/rpmc-project/src/main/java/com/._.ds_store rpmc-project/src/main/java/com/mycompany/.ds_store __macosx/rpmc-project/src/main/java/com/mycompany/._.ds_store rpmc-project/src/main/java/com/mycompany/rpmc/.ds_store __macosx/rpmc-project/src/main/java/com/mycompany/rpmc/._.ds_store                         system.out.println("wrong choice");=""                         break;=""                     }=""                                         //viewing patients booked with the particular doctor=""                     for(patient p : doctors[d_id-1].patients)=""                         system.out.println(p.timeslot+" : "+p.firstname);=""                     break;=""                                         =""                                         //case 4 shows the patients booking details=""                 case 4:=""                     system.out.println("enter the first name of the patient");=""                     string finame="br.readLine();"                     system.out.println("enter the surname of the patient");=""                     string suname="br.readLine();"                     for(patient p  : patients){=""                                       //if name and surname of the patient details booked equals to the details given by user, print details.=""                         if(p.firstname.equalsignorecase(finame) && p.surname.equalsignorecase(suname))=""                             system.out.println(p);=""                     }=""                     break;=""                                 //case 5 for exiting the program=""                 case 5:=""                     system.out.println("thank you");=""                     system.exit(0);=""                                         =""                                 //displaying message for wrong input =""                 default:=""                     system.out.println("option not available!!!\nplease try again");=""             }=""         }=""     }=""         //end class="" }="" __macosx/rpmc-project/src/main/java/._main.java="" rpmc-project/src/main/java/patient.java="" rpmc-project/src/main/java/patient.java="" public class patient {=""     //variables for patient details=""     =""     string firstname;=""     string surname;=""     long telephone;=""     string dob;=""     string country;=""     string timeslot;=""     doctor doctor;=""         =""         //constructor=""     public patient(string firstname, string surname, long telephone,=""             string dob, string country, string timeslot, doctor doctor) {=""             =""             //parse the variables into constructor and reverse=""         super();=""         firstname =" firstName;"         surname =" surname;"         telephone =" telephone;"         dob =" dob;"         this.country =" country;"         this.timeslot =" timeslot;"         this.doctor =" doctor;"     }=""         //this method overrides super-class / implements super-class's methods=""     @override=""     public string tostring() {=""         return "patient details:\n" +=""         "firstname: " + firstname + =""         "\nsurname: " + surname +=""         "\ntelephone: " + string.valueof(telephone) + =""         "\ndate of birth: " + dob + =""         "\ncountry of origin: "+ country + =""         "\ntime of the appointment: " + timeslot + =""         "\ndoctor registered: " + doctor.name;=""     }=""         //end class="" }="" rpmc-project/src/main/java/com/.ds_store="" __macosx/rpmc-project/src/main/java/com/._.ds_store="" rpmc-project/src/main/java/com/mycompany/.ds_store="" __macosx/rpmc-project/src/main/java/com/mycompany/._.ds_store="" rpmc-project/src/main/java/com/mycompany/rpmc/.ds_store="">
Answered Same DayDec 28, 2021

Answer To: RPMC-Project/.DS_Store __MACOSX/RPMC-Project/._.DS_Store RPMC-Project/pom.xml XXXXXXXXXX...

Neha answered on Jan 05 2021
146 Votes
Testing
    Feature
    Sub feature
    Input
    Expected Output
    Results
    Book Appointment
    Not providing patient name
    Select option 1 from the menu. Do not enter any name when asked for patient name
    The programme should ask for patient name again if not provided
    Failed as it is asking for other
informations without name
    
    Entering string as telephone number
    Select option 1 and enter string value for the telephone
    Programme should ask again with the message of invalid input
    Failed as programme terminates with system exception
    
    Enter char value for date of birth
    Select option 1 and enter char value for the date of birth
    The programme should show invalid input message and ask again for date of birth
    Failed as programme accepts a string any value for the date of birth
    
    Select invalid choice out of doctors
    Select option 1 and for the doctors enter 5
    The programme should inform user about invalid input and ask for doctor again
    Success as the program throws exception and terminates
Critical Report
The following report has been prepared to show and write down the experience which I have faced while working on the assignment. This report can be used as the self-reflective information for the assignment on which I've worked for developing the menu driven hospital registration application using Java language. The overall purpose of writing this report is true share my experience, approach and thoughts about the Java language which is an object-oriented programming language. Generally, the developers are using object-oriented programming language as it has multiple advantages. These languages allow the user to create a software in more reliable and convenient manner. It is easy to understand and can be reused. These types of languages are extensible and convenient according to the user.
The object-oriented programming languages allows us to create classes which makes the whole language more reliable. It allows us to create different parts of a single software and then each of them can be modified individually and it does not affect any other part of the software. The whole program or the application can be divided into multiple sub programs which makes it more convenient for the user to work on it and allows multiple users to work on the same application at the same time. The Java language allows to maintain the code easily as it allows the developer to modify the code which can be beneficial for the whole software. The Java programming language also allow the user to reuse the already created classes or the object add some other please in the whole code. The major pillars of the object-oriented programming are encapsulation, polymorphism and the inheritance. I've used these pillars in the application and the aim was to avoid any repetition of the code and achieve the re usability.
Encapsulation
Encapsulation allows the developer to encapsulate the classes which means we can encase the methods and attribute of each...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here