. . . The addRecord() Function You should design, implement and test a function which adds an appointment record to the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

. . . The addRecord() Function You should design, implement and test a function which adds an appointment record to the

Post by answerhappygod »

The Addrecord Function You Should Design Implement And Test A Function Which Adds An Appointment Record To The 1
The Addrecord Function You Should Design Implement And Test A Function Which Adds An Appointment Record To The 1 (253.55 KiB) Viewed 33 times
phython code please
. . . The addRecord() Function You should design, implement and test a function which adds an appointment record to the Diary. An appointment record will be added to the Diary each time when the 5 inputs of the appointment record are all valid. If any input is invalid, display an error message and ask user for another input. The function handles the following tasks: Collect all data (priority, date, start time, end time and subject) for the appointment record (assigned them to a string as "High: 23/9/2022; 9; 10; CSC1401 class", other formats for the string are not acceptable for this assignment); • Validate if the input for "Date" is correct regarding the specification in the Date section by using the function is ValidDate() described below; Validate if the input for "Time" is correct regarding the specification in the Time section by using the isValidTime() described below; A non-empty string within 30 characters (including space between words) for the subject “Low" and "High" are the only two valid inputs of priority, case insensitive Call isConcurrentAppointment() first then add the valid appointment record into the appointmentList list if all data are valid; The program will repeatedly ask users to input the record until "END" is input for the date. Call showRecords() to present the table of all the records. The showRecords() Function You should design, implement and test a function to print all existing records in a “table” as the Figure 2 after the task of Input Functions is completed. The function should access the appointmentList and print all existing appointment records (no requirement about the order) in the table. a “table” including headers, “-” which separate the header from the content of each record The number of “-” is equal to the maximum number of text or the length of the header for each column Indentation is appropriate as shown in Figure 2. You could create some dummy appointment records manually and store them in the appointmentList to test this function, while other functions still remain incomplete. The isValidDate() Function (Challenge task) You should design, implement and test a function to validate the data input for the Date attribute of an appointment record. The function should alert an error message and return false if the input is invalid, otherwise, return true. • Refer to the Date section for what the function needs to check for validation. To evaluate students' string handling capabilities, only the “25/9/2022" date format is a valid input format for 25th September 2022. Use of built-in functions or some libraries to input valid date is not acceptable for this assignment. . The isValidTime() Function You should design, implement and test a function to validate the time input for the start time and end time attributes of an appointment record. The function should alert an error message and return false if the input is invalid, otherwise, return true. Refer to the Time section for what the function needs to check for validation.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply