Bug 760

Summary: System crashed when we enter time in wrong format
Product: Hospital-Managment Reporter: Crist <cdragoper2-c>
Component: BugAssignee: Crist <cdragoper2-c>
Status: CONFIRMED ---    
Severity: major    
Priority: ---    
Version: 1.1   
Hardware: PC   
OS: Windows   

Description Crist 2022-12-05 22:29:49 HKT
Code sequence for Bug:

Select the type of user you are:
1. Admin
2. Patient
3. Doctor
2
Are you an existing user, enter y/n
y
Please enter your HKID
F042049
Please enter your password
abcd
Please select what you would like to do:
1. Make new appointment
2. Cancel Appointment
3. View Appointments
1
Enter the department you want to choose:
1. Orthotropics
2. Gyno
3. Emergency
3
Enter the doctor you want to choose:
1. Lav
1
Enter the date you want to choose:
1. 2022-12-03
2. 2022-12-04
3. 2022-12-05
4. 2022-12-06
5. 2022-12-07
4
Select the time at which you would like to make an appointment
18:30   14:30   14:00   16:30   16:30
15:30   17:30   13:00   12:30   19:00   19:00
12:00   10:00   10:30   15:00   18:00   18:00
09:30   09:00   11:00   17:00   11:30   11:30
13:30   16:00   19:30   9:30
Your selected details for the appointment are as follows:
Department: Emergency
Doctor: Lav
Day: 2022-12-06
Time: 9:30
Enter y to confirm or n to re-enter details:
y
Exception in thread "main" java.lang.NumberFormatException: For input string: "9:"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
        at java.base/java.lang.Integer.parseInt(Integer.java:668)
        at java.base/java.lang.Integer.valueOf(Integer.java:999)
        at Flow.NewAppointment.timeConverter(NewAppointment.java:83)
        at Flow.NewAppointment.initiate(NewAppointment.java:69)
        at Flow.FlowController.main(FlowController.java:78)