Question: Modify the solution shown earlier in Figure 7-2. The solution should now keep track of the number of times Sahirahs laser beam missed the spider.

Modify the solution shown earlier in Figure 7-2. The solution should now keep track of the number of times Sahirah’s laser beam missed the spider. After saying “You are safe now. The spider is dead.”, Sahirah should say one of the following: “I got him immediately.”, “I missed him one time.”, or “I missed him x times.” (where x is the value in the counter). 


Problem specification A superheroine named Sahirah must prevent a poisonous yellow spider from attacking King Khafra and Queen Rashida. Sahirah has one weapon at her disposal: a laser beam that shoots out from her right hand. Sahirah can take as many shots as needed to destroy the spider, which is

Problem specification A superheroine named Sahirah must prevent a poisonous yellow spider from attacking King Khafra and Queen Rashida. Sahirah has one weapon at her disposal: a laser beam that shoots out from her right hand. Sahirah can take as many shots as needed to destroy the spider, which is flying around the palace looking for the king and queen. Before taking each shot, she needs to position both her right arm and her right hand toward the spider. When the laser beam hits the spider, she should return her right arm and right hand to their original positions and then say "You are safe now. The spider is dead." Algorithm 1. position both your right arm and your right hand toward the spider 2. shoot a laser beam at the spider condition 3. repeat while (the Laser beam did not hit the spider) position both your right arm and your right hand toward the spider- shoot a laser beam at the spider- end repeat 4. return your right arm and right hand to their original positions 5. say "You are safe now. The spider is dead." loop body Figure 7-2 A problem that requires the sequence and repetition structures

Step by Step Solution

3.48 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 initialize missed counter to 0 2 position both your right ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Microsoft Visual C# Introduction Questions!