This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stanford.karel.SuperKarel; | |
public class defendDemocracyKarel extends SuperKarel { | |
/* This program is designed to clean the ballots in Karel's world. If there is no | |
* beeper in the centre, this indicates voter intent | |
* and Karel clears that whole column. | |
*/ | |
public void run() { | |
while (frontIsClear()) { | |
move(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: Pyramid.java | |
* Name: | |
* Section Leader: | |
* ------------------ | |
* This file is the starter file for the Pyramid problem. | |
* It includes definitions of the constants that match the | |
* sample run in the assignment, but you should make sure | |
* that changing these values causes the generated display | |
* to change accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: Target.java | |
* Name: | |
* Section Leader: | |
* ----------------- | |
* This file is the starter file for the Target problem. | |
*/ | |
import acm.graphics.*; | |
import acm.program.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: ProgramHierarchy.java | |
* Name: | |
* Section Leader: | |
* --------------------------- | |
* This file is the starter file for the ProgramHierarchy problem. | |
*/ | |
import acm.graphics.*; | |
import acm.program.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: PythagoreanTheorem.java | |
* Name: | |
* Section Leader: | |
* ----------------------------- | |
* This file is the starter file for the PythagoreanTheorem problem. | |
*/ | |
import acm.program.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: FindRange.java | |
* Name: | |
* Section Leader: | |
* -------------------- | |
* This file is the starter file for the FindRange problem. | |
*/ | |
import acm.program.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: Hailstone.java | |
* Name: | |
* Section Leader: | |
* -------------------- | |
* This file is the starter file for the Hailstone problem. | |
*/ | |
import acm.program.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import acm.program.*; | |
// this program prints the fibonacci sequence | |
public class sectionAssignment_2 extends ConsoleProgram { | |
// specifies max value for term in fibonacci sequence | |
private static final int MAX_TERM_VALUE = 10000; | |
public void run() { | |
introduction(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import acm.graphics.*; | |
import acm.program.*; | |
import java.awt.*; | |
public class robotFace extends GraphicsProgram { | |
private static final double HEAD_WIDTH = 200; | |
private static final double HEAD_HEIGHT = 350; | |
private static final double EYE_RADIUS = 30; | |
private static final double MOUTH_WIDTH = 110; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import acm.graphics.*; | |
import acm.program.*; | |
import acm.util.*; | |
public class randomCircles extends GraphicsProgram { | |
// specifies number of circles | |
private static final int NCIRCLES = 10; | |
// specifies minimum radius | |
private static final int RMIN = 5; |
OlderNewer