Question: BACKGROUND: Once upon a time, Reeborg fell ill and was unable to leave his house for several days. During that time, the kid that delivers

BACKGROUND: Once upon a time, Reeborg fell ill and was unable to leave his house for several days. During that time, the kid that delivers newspapers continued to deliver them in the usual manner; that is, flung about all around Reeborg's house. Finally one morning Reeborg decided he was well enough to get out of bed and pick up all the newspapers that were on his property.

TASK: Program Reeborg to leave his house and pick up all the newspapers (beepers) that are on the perimeter of his property. Reeborg should then deposit all but one of these beepers in the vestibule of his house and then return to bed with the one beeper. Retaining that beeper in his pocket, he should face west and turn off.

SITUATION DETAILS: In the initial situation, Reeborg is in his bed facing some unknown direction. His bed is defined to be the extreme southwest corner of his house, vestibule excluded. The vestibule is a single corner that juts out from his house and has a one corner wide entrance to the house on one end and an exit on the other. The vestibule is walled on the other two sides. Reeborg's house is a rectangle guaranteed to be at least two corners high and wide. Except for the vestibule walls, there are no protusions or obstacles on the perimeter of the rectangle. There are no obstacles within the house. If any beepers are inside the house, they are to be ignored. Reeborg's property line includes only those corners that lie on the perimeter of his house. That is, only those corners that are adjacent horizontally, vertically, or diagonally to the walls of his house. This includes corners adjacent to the vestibule. More than one paper may have fallen on the same street corner. There will always be at least one paper on the perimeter. Ignore papers that are not on Reeborg's property. Reeborg's property will never be restricted in such a way as to make it impossible for Reeborg to make a complete circuit around his property.

CRITICAL OBSERVATIONS: Once again, this assignment is meant to exercise YOUR ability to design programs; neither offer nor accept any additional help, except on a one-to-one basis with the instructor (or official CS tutor). Remember the Academic Honesty pledge you signed earlier in the semester. This, and future assignments, are subject to automated plagiarism scanning (typically using Moss) as well as special grader scrutiny and peer review. Also, although Handout 37 on Stepwise Refinement might provide some insight in how to attack problems such as this, none of the code in that handout is useful in or directly applicable to this task.BACKGROUND: Once upon a time, Reeborg fell ill and was unable to

w 7 7 6 0 3 5 5 4 3 2 7 6 5 4 3 3 5 2 MIC l@@ 6 3 6 5 5 4 4 3 2 2 4 7 8 10 w 7 7 6 0 3 5 5 4 3 2 7 6 5 4 3 3 5 2 MIC l@@ 6 3 6 5 5 4 4 3 2 2 4 7 8 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!