This question extends the Skeleton Program by allowing a player to use a blasting cap to complete any challenge on the current lock.
The player will only be able to do this once per game.
When the player chooses to use the blasting cap, the program should check if the player has already used the blasting cap. If they have not used the blasting cap, the program should:
change the status of the blasting cap to show that it has been used
ask the player to enter the position of the challenge on the current lock they would like to use the blasting cap on (1 for the first challenge, 2 for the second challenge, etc)
check: o that the position entered is less than or equal to the number of challenges on the current lock o that the challenge in that position has not already been met.
if both these checks are passed: o mark the challenge as being met o display a message saying the blasting cap was used successfully o display the details for the current lock.
if either of these checks fail, then the blasting cap has been wasted and the game continues.
If the player tries to use the blasting cap when they have already used it then nothing changes and the game continues.
What you need to do
Task 1 Modify the GetChoice subroutine in the Breakthrough class so the message displayed shows the blasting cap option.
Task 2 Modify the PlayGame subroutine in the Breakthrough class so that there is a blasting cap that works in the way described.
Task 3 Test that the changes you have made work:
run the Skeleton Program
enter L
choose to use a blasting cap
choose to complete the third challenge on the current lock
choose to use a blasting cap.