Bug 832 - Program crashes when using AE system with 0 doctor.
Summary: Program crashes when using AE system with 0 doctor.
Status: CONFIRMED
Alias: None
Product: Hospital System
Classification: Unclassified
Component: AE System (show other bugs)
Version: Alpha Release
Hardware: PC Windows
: High critical
Assignee: klhwong3-c
URL: N/A
Depends on:
Blocks:
 
Reported: 2023-12-10 00:59 HKT by hongjlee2-c
Modified: 2023-12-10 00:59 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hongjlee2-c 2023-12-10 00:59:37 HKT
Step To Reproduce:
1. Login.
2. Make sure to have no AE doctor. (You will have no AE doctor by default) 
3. Input “2” to enter the AE system.
4. Input “1” to get a ticket and input any illness (e.g. “fever”)

Actual Results:
The program prints out crashes with an ArithmeticException exception.

Expected Results:
The program should not crash and give the ticket.

Suggested Fix:
We should have the list of doctors in AE.java. Add a condition to check whether this list is empty or not.