AP Computer Science A
Download the following gitHub repository: https://github.com/danielappel/KarelLabSix
This lab explores one-dimensional arrays.
You will revisit the beeper steeple problem from lab #4. You must program a robot to collect and count all the beepers. There are 13 avenues that need to be collected (2nd Ave - 14th Ave). The number of beepers should be stored in the array (beeperList) given in the BeeperBot class.
Karel should arrange vertical piles of beepers into ascending order. Each avenue, starting at the origin, will contain a vertical pile of one or more beepers. The following beepers should all be collected and the columns resorted (shown below)
BEFORE
AFTER
<<INSERT SOLUTION CODE HERE>>
Karel is building a fence. The fence will be made of beepers and will surround a rectangular shaped wall segment. The size of the wall segment is unknown. Kare is at the origin facing in an unknown direction. The beepers are stacked on the western boundary wall. There are exactly enough beepers to build the fence. The beeper pile is on the street that is adjacent to the wall segment. Program karel to build the fence and return to the origin. Assume that there are no beepers in karel’s bag at the start of the program.
<<INSERT SOLUTION CODE HERE>>
Write a loop that would access each item of the following array:
int[] ages = [4, 15, 6, 9, 10, 13, 21]
<<INSERT SOLUTION CODE HERE>>