Menu

[solved]-Write Program Allows Students Schedule Appointments Either 1 2 3 4 5 6 O Clock Pm Use Arra Q39049088

Code in Java please:
Write a program that allows students to schedule appointments at either 1, 2, 3, 4, 5, or 6 o@clock pm. Use an array to storeWrite a program that allows students to schedule appointments at either 1, 2, 3, 4, 5, or 6 o@clock pm. Use an array to store each of the six (strings) of names for the 6 time slots. Write a loop that iterates as long as the array has a freespace (program should end when all time slots are taken). Within a try block, allow the user to enter a time and a name. If the time is free, put the name in the array. If the time is not free, throw a TimeInUseException. If the time is not valid, throw an InvalidTimeException. Use a catch block for each different kind of exception. The exceptions should NOT exit the program but perform actions to help user: TimeInUseException – could be used to ask user to input a different time. InvalidTimeException – could be used to enter a valid time. Please test your program with valid data, along with data which will cause the two exceptions to be thrown. Show transcribed image text Write a program that allows students to schedule appointments at either 1, 2, 3, 4, 5, or 6 o@clock pm. Use an array to store each of the six (strings) of names for the 6 time slots. Write a loop that iterates as long as the array has a freespace (program should end when all time slots are taken). Within a try block, allow the user to enter a time and a name. If the time is free, put the name in the array. If the time is not free, throw a TimeInUseException. If the time is not valid, throw an InvalidTimeException. Use a catch block for each different kind of exception. The exceptions should NOT exit the program but perform actions to help user: TimeInUseException – could be used to ask user to input a different time. InvalidTimeException – could be used to enter a valid time. Please test your program with valid data, along with data which will cause the two exceptions to be thrown.

Expert Answer


Answer to Write a program that allows students to schedule appointments at either 1, 2, 3, 4, 5, or 6 o@clock pm. Use an array to … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *