Question: Write a program that will have Karel climb a series of walls, with the height of each wall not exceeding 3 sections tall. Karel will

Write a program that will have Karel climb a series of walls, with the height of each wall not exceeding 3 sections tall. Karel will be expected to move from avenue 1, street 1, initially facing East by climbing walls until he reaches Avenue 5, street 1, facing East. The attached world file (Wall Climber.kw Download Wall Climber.kw) is an example of what the worldCOULDlook like. To download a copy of the world file, simply click the icon to the right of the file and save it to the same location as your Karel program. Make sure you do not double-click on this file to open it, it MUST be opened from within the Karel program. Upload only your program file on this one. I will run your program against a world of my making and your program should run without modifications inside my world file. The world file I will use will NOT violate any of the conditions above.
The Rules:
1. Karel is initially facing East on Street 1, Avenue 1 with no beepers in his bag
2. Karel will NOT pick up, nor place, any beepers in this program.
3. Karel will be expected to determine if he needs to climb a wall in front of him. If he does, he climbs it. If there is no wall directly in front of him, he will simply move to the next corner and check for a wall there to climb. Karel will also climbONLYas high as he needs to in order to clear the wall (do NOT have him climb 3 sections if only one or two are there!)
4. Karel will climb any and all walls between Avenue 1 and Avenue 5.
5. Karel ends at Street 1, Avenue 5, facing East.
6. You MUST use nested IF statements to climb the walls. I willNOTaccept a program that uses a loop to get Karelupordownthe wall.If you use loops to have Karel climb up or down the walls, you will receive a 0 for this assignment.I want you to see how meticulous nesting if statements can be. The only place in this program you can (and I expect you to) use a loop in this program is to have him iterate your overall module 4 times to get him from Avenue 1 to Avenue 5.
7. No errorshutoffs.

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 Programming Questions!