/* This program should clean up all the balls in any size world. */functionmain(){while(leftIsClear()){cleanRow();comeBack();moveUp();}cleanRow();comeBack();if(leftIsBlocked()){returnHome();}}/* Karel moves up to the next row.
* Precondition: Karel is at the start of a just cleaned row.
* Postcondition: Karel is at the start of the next row to
* be cleaned, facing east. */functionmoveUp(){turnLeft();move();turnRight();}/* This brings Karel back to the starting position on the row.
* Precondition: Karel is at the end of the row, facing a wall.
* Postcondition: Karel is at the start of the same row, facing
* east.
*/functioncomeBack(){turnAround();while(frontIsClear()){move();}turnAround();}/* This cleans one row of Karel's world.
* Precondition: Karel is in the first column, facing east
* Postcondition: Karel is at the end of the row, facing
* east, and all balls in the row have been picked up.
*/functioncleanRow(){while(frontIsClear()){cleanSpot();move();}cleanSpot();}/* This picks up a tennis ball, but only if it is there. */functioncleanSpot(){if(ballsPresent()){takeBall();}}/* This brings Karel back to the starting position, facing east.
* Precondition: Karel is at the end of the clean up.
* Postcondition: Karel is back to (1,1), facing east.
*/functionreturnHome(){turnRight();while(frontIsClear()){move();}turnLeft();}main();
Attend all classes. If you are absent, it is your responsibility to make up the work (not mine).
Complete all of the assignments to the best of your ability. You will not succeed in this class if you don’t do the work.
Be prepared in your seat, when the second bell goes
Only one person talks at a time. This includes any/all announcements. Do not be typing on the keyboard or playing with your mouse also falls under this category.
Leave your area as you found it. Push in your chair, log out of the computer , the equipment should be in the condition you found it.
CLOSE THE CLASSROOM DOOR!!!
Do not live on your cellular phone, if I notice it, I will take it away.
Typing
This will be your warm-up activity when you come into class