Question: This section is for marking purposes only. There is nothing for you to submit here. Testing Script (Total 10 marks) This output script will test:
This section is for marking purposes only. There is nothing for you to submit here.
Testing Script (Total 10 marks)
This output script will test:
public boolean add( E item )
Dynamic Array resizing
List the contents of the ArrayBox (option 4)
OUTPUT:
=[==[==[=[=================================]=]==]==]= =[==[==[=[ 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 >>1st =[==[==[=[=================================]=]==]==]= =[==[==[=[ 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 >>2nd =[==[==[=[=================================]=]==]==]= =[==[==[=[ 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 >>3rd (ATTN: array capacity has been resized to hold a maximum of 4) [6 MARKS] Note: for the full 6 marks this message must be displayed saying what the size of the new array is (i.e: 4). If it only states "array has been resized" without specifying the new array size then only 5 marks given.
=[==[==[=[=================================]=]==]==]= =[==[==[=[ 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 >> 4 [ 4 MARKS ] INDEX VALUE 0 1st 1 2nd 2 3rd =[==[==[=[=================================]=]==]==]= =[==[==[=[ 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
