The isConcurrentAppointment() Function (Challenge task) You should design, implement and test a function to validate if
Posted: Fri May 20, 2022 10:08 am
The isConcurrentAppointment() Function (Challenge task) You should design, implement and test a function to validate if the input data for the Date, Start Time and End Time of an appointment is concurrent to any existing appointments in the appointmentList. The time of two appointments is considered concurrent if the time span for the two appointments overlap each other in full or in part. Note that an appointment can start at a time when another finishes, or vice versa. An appointment starts and finishes on the same day The function should alert an error message and return true if the input appointment is concurrent with any existing appointments in appointmentList, otherwise, return false. The sortRecords() Function You should design, implement and test a function to allow the user to sort all appointment records in appointmentList based on one of the following attributes: Priority and Time, and then display the sorted appointment records of Diary when the user enters the corresponding keyword. The program will repeatedly ask users to input the attribute (eg the hints “Do you want to sort the appointments by time or priority”. Only “time”, “priority” and “END” are valid inputs, case insensitive) until "END" is entered to stop the iteration. You should use the following suggestions as the guideline: • Priority: "High" to "Low" (For the "High" or "Low" groups of records, no requirement about the order if the priorities of records are the same); • Time: from earlier date to later date. For same day records, earlier start time is in front (Challenge task) You should use string handling techniques to extract the corresponding attribute values from the appointment records and sort the appointment records based on these values. The outcome should be similar to Figure 3.