1. Implement a class named Appointment that contains: • A private String data field named patientName. • A private int data field named newID. This value will be automatically incremented with the...

What is the solution for this question ( using java language)1. Implement a class named Appointment that contains:<br>• A private String data field named patientName.<br>• A private int data field named newID. This value will be automatically incremented<br>with the creation of each Appointement object. The initial value of newID is 1.<br>• A private constant (final) int data field named APPOINTEMENT_ID.<br>• A private int data field named day. The value represents the day of the week from 1 to<br>5, (1 for Monday, 2 for Tuesday, and so on till Friday).<br>• A private int data field named hour. Accepted values are 8, 9, 10, ...14<br>• A constructor that creates a new appointment with specific patient Name given as<br>argument. Then, the appointment will be immediately assigned a APPOINTEMENT_ID<br>according to newID.<br>• The accessor (getter) methods for patientName and APPOINTEMENT_ID.<br>• The accessor and mutator (setter) methods for the day and hour fields. Note that if the<br>day value is not in [1,5] then the field is set 0. Also, if the hour is not in [8,14], the field<br>value is set to 0.<br>• The method getDayOfTheWeek returns a string representing the day of the week. For<br>instance, if the day is 1, the method returns

Extracted text: 1. Implement a class named Appointment that contains: • A private String data field named patientName. • A private int data field named newID. This value will be automatically incremented with the creation of each Appointement object. The initial value of newID is 1. • A private constant (final) int data field named APPOINTEMENT_ID. • A private int data field named day. The value represents the day of the week from 1 to 5, (1 for Monday, 2 for Tuesday, and so on till Friday). • A private int data field named hour. Accepted values are 8, 9, 10, ...14 • A constructor that creates a new appointment with specific patient Name given as argument. Then, the appointment will be immediately assigned a APPOINTEMENT_ID according to newID. • The accessor (getter) methods for patientName and APPOINTEMENT_ID. • The accessor and mutator (setter) methods for the day and hour fields. Note that if the day value is not in [1,5] then the field is set 0. Also, if the hour is not in [8,14], the field value is set to 0. • The method getDayOfTheWeek returns a string representing the day of the week. For instance, if the day is 1, the method returns "Monday". If the day is 2, it returns "Tuesday" and so on. If the day is 0, the method returns "Undefineď". • The method getApprointmentDetails that returns a string representation of the approintment. It contains the appointment ID, the patientName followed by a dash followed by the day of the week and the hour. For example: Appointment #1: The patient is HassanMohana - Monday at 10 o'clock. Write a main program to: Create two different appointment. The first appointment object is for patient "MayaMroueh" on “Thursday" at “13 pm". The second appointment object is read from the user. Write the code to check if the two appointments conflict in day and time. If so it prints a message “The two appointments are set for the same day and day". And moves one of the appointments to the next day. Write the code to display the appointments information using the method getApprointmentDetails. Assignment Guidelines: This assignment is posted on Monday November 1“ and is due on Sunday November 7th. This assignment covers chapters 8. Assignments (the .java files or better a complete java project compressed) should be posted to Google Classroom. Do not post documents/text files with the .docx or .txt extension. Make sure that you use meaningful names, documentation (comments), and indentation. The code (program) should contain in the documentation (comments) your name.
Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here