Question: This section is for marking purposes only. There is nothing for you to submit here. For Marking (Total 2.5 marks) This script tests error handling.
This section is for marking purposes only. There is nothing for you to submit here.
For Marking (Total 2.5 marks)
This script tests error handling. Make sure you throw and catch exceptions.
=[==[==[=[=================================]=]==]==]= =[==[==[=[ Welcome to ArrayBox ]=]==]==]= =[==[==[=[=================================]=]==]==]= Choose... 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. List the contents of the box. 5. Exit program >> 2 Enter the INDEX of the item you want removed from the box >>1000 ERROR! The box is currently empty. [0.5 marks]
=[==[==[=[=================================]=]==]==]= =[==[==[=[ Welcome to ArrayBox ]=]==]==]= =[==[==[=[=================================]=]==]==]= Choose... 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. List the contents of the box. 5. Exit program >> 1 Enter an String you want to add to the ArrayBox >>test =[==[==[=[=================================]=]==]==]= =[==[==[=[ Welcome to ArrayBox ]=]==]==]= =[==[==[=[=================================]=]==]==]= Choose... 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. List the contents of the box. 5. Exit program >> 2 Enter the INDEX of the item you want removed from the box >>1000 ERROR! Index must be between 0 and 0 [ 0.5 marks]
=[==[==[=[=================================]=]==]==]= =[==[==[=[ Welcome to ArrayBox ]=]==]==]= =[==[==[=[=================================]=]==]==]= Choose... 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. List the contents of the box. 5. Exit program >> 2 Enter the INDEX of the item you want removed from the box >>-1 ERROR! Index must be between 0 and 0 [0.5 marks]
=[==[==[=[=================================]=]==]==]= =[==[==[=[ Welcome to ArrayBox ]=]==]==]= =[==[==[=[=================================]=]==]==]= Choose... 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. List the contents of the box. 5. Exit program >> 3 Enter the INDEX of the item you want changed from the box >>1000 Enter the String for the item >>test ERROR! Index is out-of-bounds [0.5 marks] =[==[==[=[=================================]=]==]==]= =[==[==[=[ Welcome to ArrayBox ]=]==]==]= =[==[==[=[=================================]=]==]==]= Choose... 1. Add an element(String) to our box. 2. Remove an element(String) from our box. 3. Replace(set) an element(String) from our box. 4. List the contents of the box. 5. Exit program >> 3 Enter the INDEX of the item you want changed from the box >>-1 Enter the String for the item >>test ERROR! Index is out-of-bounds [0.5 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
