© A+ Computer Science - www.apluscompsci.com. Visit us at www.apluscompsci.com Full Curriculum Solutions www.apluscompsci.com M/C Review Question Banks.

Slides:



Advertisements
Similar presentations
GridWorld Case Study The Classes A Summary by Jim Mims.
Advertisements

GridWorld Case Study Part 2 Bug Variations A Summary by Jim Mims.
© A+ Computer Science - GridWorld © A+ Computer Science -
Big Ideas behind Inheritance. Can you think of some possible examples of inheritance hierarchies?
Arrays and ArrayLists Ananda Gunawardena. Introduction Array is a useful and powerful aggregate data structure presence in modern programming languages.
Big Java by Cay Horstmann Copyright © 2008 by John Wiley & Sons. All rights reserved. It is common to use two nested loops when filling or searching: for.
How to do well on the AP CS Free Response Questions
Critters A Study in Design Patterns. Design Patterns  Not specific algorithms or data structures  A general reusable solution to a common problem.
Using a different image than normal Multiple images for a class Controlling the mouse click Controlling the keys pressed Launching an input dialog box.
AP Computer Science.  Not necessary but good programming practice in Java  When you override a super class method notation.
© A+ Computer Science - ArrayList © A+ Computer Science - Lab 16.
One Dimensional Arrays. Declaring references to array objects How would you declare a variable somearray that is an array of ints? int[] somearray;
Multiple Choice Solutions True/False a c b e d   T F.
GridWorld Case Study1 Barbara Ericson Georgia Tech Jan 2008.
© A+ Computer Science - Inheritance © A+ Computer Science - Lab 20.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
© A+ Computer Science - public Triangle() { setSides(0,0,0); } Constructors are similar to methods. Constructors set the properties.
© A+ Computer Science - Row = 0 Column = 0.
How to do well on the AP CS Free Response Questions
M180: Data Structures & Algorithms in Java Arrays in Java Arab Open University 1.
GridWorld Case Study Barbara Ericson March 24, 2007.
Java Arrays  Java has a static array capable of multi-dimensions.  Java has a dynamic array, which is also capable of multi-dimensions.  The ArrayList.
OBJECTS FOR ORGANIZING DATA -- As our programs get more sophisticated, we need assistance organizing large amounts of data. : array declaration and use.
ArrayList Class An ArrayList is an object that contains a sequence of elements that are ordered by position. An ArrayList is an object that contains a.
© A+ Computer Science - Which of the following statements assigns the letter S to the third row and first column of a two-dimensional.
© A+ Computer Science - Grid is an interface that details the behaviors expected of a grid. All its methods are abstract methods.
AP Computer Science edition Review 1 ArrayListsWhile loopsString MethodsMethodsErrors
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Types and Interfaces COMP.
The GridWorld Case Study Program Section 1 - Overview of the Class Hierarchies Section 2 - The Actor Class Section 3 - The Rock and Flower Classes Section.
Arrays and ArrayLists Topic 6. One Dimensional Arrays Homogeneous – all of the same type Contiguous – all elements are stored sequentially in memory For.
GridWorld Case Study The case study is a program that simulates actions and interactions of objects in a two- dimensional grid. During a single step of.
© A+ Computer Science - Visit my site at Full Curriculum Solutions M/C Review Question Banks Live Programming.
How to do well on the AP CS Free Response Questions
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 7A Arrays (Concepts)
Chapter 9 Introduction to Arrays Fundamentals of Java.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
LESSON 8: INTRODUCTION TO ARRAYS. Lesson 8: Introduction To Arrays Objectives: Write programs that handle collections of similar items. Declare array.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks.
© A+ Computer Science - Elevens is a lab about classes and Lists. List is a major concept being tested by the Elevens lab. Elevens.
GridWorld.
Topic Dimensional Arrays
Agenda About Quiz ChameleonCritter class CrabCritter class homework.
Barbara Ericson Georgia Tech Jan 2008
A+ Computer Science AP Review 2018 AP CS A EXAM
Multiple Choice -answer the easiest question 1st
Nested Loop Review and Two-Dimensional Arrays
© A+ Computer Science - GridWorld © A+ Computer Science -
© A+ Computer Science - GridWorld © A+ Computer Science -
© A+ Computer Science - Arrays and Lists © A+ Computer Science -
© A+ Computer Science - OOP © A+ Computer Science -
The Matrix A b a d e a a a a a a a A b a d e a a a a a a a
Lecture 13: Two-Dimensional Arrays
© A+ Computer Science - OOP Pieces © A+ Computer Science -
© A+ Computer Science - GridWorld The GridWorld case study provides a graphical environment where visual objects inhabit and interact.
© A+ Computer Science - GridWorld © A+ Computer Science -
GridWorld Case Study.
© A+ Computer Science - GridWorld © A+ Computer Science -
A+ Computer Science AP Review 2019 AP CS A EXAM
© A+ Computer Science - GridWorld © A+ Computer Science -
Presentation transcript:

© A+ Computer Science -

Visit us at Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content!

© A+ Computer Science -

ArrayList of References / Objects – get,set,remove,add,size – levels of abstraction Matrix / 2 D Array – nested loops, GridWorld ( grid ) GridWorld or Make a Class – location, actor, bug, critter, grid, super, abstract String / Array Question – find biggest, find smallest, etc.

© A+ Computer Science - -Read all 4 questions before writing anything -answer the easiest question 1 st -most times question 1 is the easiest -see if part B calls part A and so on -many times part C consists of A and B calls -write something on every question -write legibly / use PENCIL!!!!!!!!!! -keep track of your time

© A+ Computer Science - -When writing methods -use parameter types and names as provided -do not redefine the parameters listed -do not redefine the methods provided -return from all return methods -return correct data type from return methods

© A+ Computer Science - -When writing a class or methods for a class -know which methods you have -know which instance variables you have -check for public/private on methods/variables -return from all return methods -return correct data type from return methods

© A+ Computer Science - -When extending a class -know which methods the parent contains -have the original class where you can see it -make sure you have super calls -check for public/private on methods/variables -make super calls in sub class methods as needed

© A+ Computer Science - -When extending abstract / implementing interface -know which methods the parent contains -have the original class where you can see it -make sure you have super calls -check for public/private on methods/variables -make super calls in sub class methods as needed -implement all abstract methods in sub class

© A+ Computer Science - -When writing GridWorld question -use the GridWorld quick reference -use original method code when overidding -use Bug and BoxBug code if extending Bug -use Critter and ChameleonCritter code if extending Critter -use Critter and Bug for extends demo -use Critter for ArrayList and Math.random() demo -use GW quick reference on the entire AP test

© A+ Computer Science - ArrayList of References / Objects – get,set,remove,add,size – levels of abstraction Matrix / 2 D Array – nested loops, GridWorld ( grid ) GridWorld or Make a Class – location, actor, bug, critter, grid, super, abstract String / Array Question – find biggest, find smallest, etc.

© A+ Computer Science - A typical ArrayList question involves putting something into an ArrayList and removing something from an ArrayList.

© A+ Computer Science - Arraylist is a class that houses an array. An ArrayList can store any type. All ArrayLists store the first reference at spot / index position 0.

© A+ Computer Science nums int[] nums = new int[10]; //Java int array An array is a group of items all of the same type which are accessed through a single identifier.

© A+ Computer Science - ArrayList frequently used methods NameUse add(item)adds item to the end of the list add(spot,item)adds item at spot – shifts items up-> set(spot,item)put item at spot z[spot]=item get(spot)returns the item at spot return z[spot] size()returns the # of items in the list remove()removes an item from the list clear()removes all items from the list import java.util.ArrayList;

© A+ Computer Science - List ray = new ArrayList(); ray.add("hello"); ray.add("whoot"); ray.add("contests"); out.println(((String)ray.get(0)).charAt(0)); out.println(((String)ray.get(2)).charAt(0)); ray stores Object references. OUTPUT h c

© A+ Computer Science - List ray; ray = new ArrayList (); ray.add("hello"); ray.add("whoot"); ray.add("contests"); out.println(ray.get(0).charAt(0)); out.println(ray.get(2).charAt(0)); ray stores String references. OUTPUT h c

© A+ Computer Science - int spot=list.size()-1; while(spot>=0) { if(list.get(spot).equals("killIt")) list.remove(spot); spot--; }

© A+ Computer Science - for(int i=list.size()-1; i>=0; i--) { if(list.get(i).equals("killIt")) list.remove(i); }

© A+ Computer Science - int spot=0; while(spot<list.size()) { if(list.get(spot).equals("killIt")) list.remove(spot); else spot++; }

© A+ Computer Science -

public void addClimb( String peakName, int climbTime ) { ClimbInfo c = new ClimbInfo( peakName, climbTime ); climbList.add( c ); } You must know ArrayList!

public void addClimb( String peakName, int climbTime ) { ClimbInfo c = new ClimbInfo( peakName, climbTime ); for( int i = 0; i < climbList.size(); i++ ) { int x = peakName.compareTo( climbList.get(i).getName() ); if( x <= 0 ) { climbList.add( i, c ); break; } } if( sz == climbList.size() ) climbList.add( c ); } You must know ArrayList!

NO YES You must know ArrayList!

© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content!

© A+ Computer Science - One question on the A test free response will require that you create a class. Sometimes you have to extend an abstract class or implement an interface. Other times, you will extend another class like Critter.

© A+ Computer Science - Location frequently used methods NameUse Location(row, col)creates a new row,col Location getCol()gets the column value for this location getRow()gets the row value for this location getAdjacentLocation( x)get a loc adjacent to x getDirectionToward( x )get the dir to another actor import info.gridworld.grid.Location;

© A+ Computer Science - Location frequently used fields NameUse NORTHindicates going north – value of 0 SOUTHindicates going south – value of 180 EASTindicates going east – value of 90 WESTindicates going west – value of 270 import info.gridworld.grid.Location;

© A+ Computer Science - Location locOne = new Location(2,1); Location locTwo = new Location(1,3); out.println(locOne.getAdjacentLocation(Location.NORTH)); out.println(locOne.getAdjacentLocation(Location.SOUTH)); out.println(locOne.getAdjacentLocation(Location.EAST)); out.println(locOne.getAdjacentLocation(Location.WEST)); OUTPUT (1, 1) (3, 1) (2, 2) (2, 0) 0,00,10,20,30,4 1,01,11,21,31,4 2,02,12,22,32,4 3,03,13,23,33,4

© A+ Computer Science - Location locOne = new Location(2,1); Location locTwo = new Location(1,3); out.println(locOne.getDirectionToward(locTwo)); OUTPUT 45 0,00,10,20,30,4 1,01,11,21,31,4 2,02,12,22,32,4 3,03,13,23,33,4

© A+ Computer Science - Actor frequently used methods NameUse Actor()creates new blue north bound actor act()reverses the direction for actor getColor()gets the actor’s color getDirection()gets the actor’s direction getLocation()gets the actor’s location setColor(col)sets the actor’s color to col setDirection(dir)sets the actor’s direction to dir moveTo(loc)moves the actor to new location loc

© A+ Computer Science - Actor frequently used methods NameUse putSelfInGrid(grid, loc)put this actor in grid at loc removeSelfFromGrid()takes this actor out of the grid getGrid()gets the grid which contains this actor toString()gets actor data as a String import info.gridworld.actor.Actor;

© A+ Computer Science - ActorWorld world = new ActorWorld(); Actor dude = new Actor(); dude.setColor(Color.GREEN); dude.setDirection(Location.SOUTH); Location loc = new Location(2,2); world.add(loc, dude); world.show(); What happens if you click on an empty location?

© A+ Computer Science - Grid abstract methods NameUse get(loc)returns the ref at location loc getEmptyAdjacentLocations(loc)gets the valid empty locs in 8 dirs getNeighbors(loc)returns the objs around this getNumCols()gets the # of cols for this grid getNumRows()gets the # of rows for this grid getOccupiedAdjacentLocations(loc)gets the valid locs in 8 dirs that contain objs getOccupiedLocations()gets locs that contain live objs getValidAdjacentLocations(loc)gets the valid locs in 8 dirs isValid(loc)checks to see if loc is valid put(loc, obj)put the obj in grid at location loc remove(loc)take the obj at location loc out of the grid import info.gridworld.grid.Grid;

© A+ Computer Science - Grid is an interface that details the behaviors expected of a Grid. Grid was designed as an interface because many different structures could be used to store the grid values. An interface works perfectly due to the large number of unknowns.

© A+ Computer Science - Grid grd; grd = new BoundedGrid ( 4, 5 ); grd.put( new Location( 2, 2 ), "CAT" ); grd.put( new Location( 1, 3 ), "DOG" ); System.out.println( grd.get( new Location( 0, 0 ) ); System.out.println( grd.get( new Location( 2, 2 ) ); OUTPUT null CAT null DOGnull CATnull

© A+ Computer Science - Bug extends Actor frequently used methods NameUse act()move if possible or turn getColor()gets the bug’s color getDirection()gets the bug’s direction getLocation()gets the bug’s location setColor(col)sets the bug’s color to col setDirection(dir)sets the bug’s direction to dir import info.gridworld.actor.Bug;

© A+ Computer Science - Bug extends Actor frequently used methods – Bug only NameUse Bug()make a new red bug going north Bug(color)make a new color bug act()move if possible or turn canMove()check to see if a move is possible move()move forward and leave a flower turn()turn 45 degrees without moving import info.gridworld.actor.Bug;

© A+ Computer Science - ActorWorld world = new ActorWorld(); Bug dude = new Bug(); world.add(new Location(3,3), dude); Bug sally = new Bug(Color.GREEN); sally.setDirection(Location.SOUTHEAST); world.add(new Location(2,2), sally); Bug ali = new Bug(Color.ORANGE); ali.setDirection(Location.NORTHEAST); world.add(new Location(1,1), ali); world.show();

© A+ Computer Science - The bug act method looks to see if a move is possible by calling canMove. canMove looks at the location in front of this bug to see if it is empty or if it contains a flower. canMove returns true or false.

© A+ Computer Science - The bug act method calls move if canMove returns true. move calls moveTo to move the bug to the location in front of this bug. move leaves a flower in the old location.

© A+ Computer Science - The bug act method calls turn if canMove returns false. turn changes the direction of the bug by 45 degrees to the right.

© A+ Computer Science - Critter extends Actor frequently used methods NameUse getColor()gets the critter's color getDirection()gets the critter's direction getLocation()gets the critter's location setColor(col)sets the critter's color to col setDirection(dir)sets the critter's direction to dir import info.gridworld.actor.Critter;

© A+ Computer Science - Critter extends Actor frequently used methods – Critter specific NameUse act()calls the methods listed below getActors()gets all actors around this location processActors(actors)do something to actors sent in getMoveLocations()gets list of possible move locs selectMoveLocation(locs)picks loc to move to makeMove(loc)moves this critter to loc import info.gridworld.actor.Critter;

© A+ Computer Science - if no grid present – stop call getActors to get list of actors to proces processActors received from getActors call getMoveLocations to get a list of locations to which the critter might move call selectMoveLocation to select new location move to the new loc

© A+ Computer Science - The getActors method returns an ArrayList containing all of the actors around this critter using the 4 cardinal(N,S,E,W) and 4 intercardinal directions(NE, NW, SE, SW). In order to change which actors are returned by getActors, override the method and provide a different method of selecting actors. getActors must not modify any actors.

© A+ Computer Science - A typical Abstract/Interface question requires that a class be written that extends the abstract class or implements the interface and that all abstract method(s) be implemented.

© A+ Computer Science - Abstract classes are used to define a class that will be used only to build new classes. No objects will ever be instantiated from an abstract class.

© A+ Computer Science - Mammal (abstract class) HumanWhaleCow

© A+ Computer Science - Any sub class that extends a super abstract class must implement all methods defined as abstract in the super class.

© A+ Computer Science - abstract class Monster{ private String myName; public Monster() { myName =""; } public Monster(String name) { myName =name; } public String getName() { return myName; } public abstract void talk( ); public String toString() { return myName + "\n"; }

© A+ Computer Science - Why define talk as abstract? public abstract void talk( ); Does each Monster say the exact same thing?

© A+ Computer Science - class Vampire extends Monster { public Vampire( String name ) { super(name); } public void talk() { out.println("Vampire " + getName() + " say \"I want to drink your blood!\""); }

© A+ Computer Science - public abstract class APlus { public APlus(int x) //constructor code not shown public abstract double goForIt(); //other fields/methods not shown } Pet Item

© A+ Computer Science - public class PassAPTest extends APlus { public PassAPTest(int x) { super(x); } public double goForIt() { double run=0.0; //write some code - run = x*y/z return run; } //other fields/methods not shown } public abstract class APlus { public APlus(int x) //constructor code not shown public abstract double goForIt(); //other fields/methods not shown }

© A+ Computer Science - public interface Exampleable { int writeIt(Object o); int x = 123; } Methods are public abstract! Variables are public static final!

© A+ Computer Science - public interface Exampleable { public abstract int writeIt(Object o); public static final int x = 123; } Methods are public abstract! Variables are public static final!

© A+ Computer Science - An interface is a list of abstract methods that must be implemented. An interface may not contain any implemented methods. Interfaces cannot have constructors!!!

© A+ Computer Science - Interfaces are typically used when you know what you want an Object to do, but do not know how it will be done. If only the behavior is known, use an interface.

© A+ Computer Science - Abstract classes are typically used when you know what you want an Object to do and have a bit of an idea how it will be done. If the behavior is known and some properties are known, use an abstract class.

© A+ Computer Science -

public class RetroBug extends Bug { private Location savedLocation; private int savedDirection; public void act() { savedLocation = getLocation(); savedDirection = getDirection(); super.act(); } public void restore() { if( savedLocation == null ) return; setDirection( savedDirection ); if( getGrid().get(savedLocation) == null || getGrid().get(savedLocation) instanceof Flower ) { moveTo( savedLocation ); }

© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content!

© A+ Computer Science - One question on the A test free response is usually an array or string question. CustomerSort Robot Reservation StringCoder

© A+ Computer Science - This question usually involves an array and / or a string and many times has sorting and searching components.

© A+ Computer Science nums int[] nums = new int[10]; //Java int array An array is a group of items all of the same type which are accessed through a single identifier.

© A+ Computer Science snull String[] s = new String[5]; Arrays are automatically filled with values when instantiated.

© A+ Computer Science - String frequently used methods NameUse substring(x,y)returns a section of the string from x to y not including y substring(x)returns a section of the string from x to length-1 length()returns the # of chars charAt(x)returns the char at spot x indexOf(c)returns the loc of char c in the string, searching from spot 0 to spot length-1 lastIndexOf(c)returns the loc of char c in the string, searching from spot length-1 to spot 0

© A+ Computer Science - String frequently used methods NameUse equals(s)checks if this string has same chars as s compareTo(s)compares this string and s for >,<, and == trim()removes leading and trailing whitespace replaceAll(x,y)returns a new String with all x changed to y toUpperCase()returns a new String with uppercase chars toLowerCase()returns a new String with lowercase chars

© A+ Computer Science - String sent = "alligators rule"; String find = "gato"; System.out.println( sent.indexOf( find ) ); System.out.println( sent.indexOf( "dog" ) ); System.out.println( sent.substring( 3, 6 ) ); System.out.println( sent.substring( 6 ) ); OUTPUT 4 -1 iga tors rule

© A+ Computer Science -

public int findHorseSpace( String name ) { for( int i = 0; i < spaces.length; i++ ) { if( spaces[i] != null ) if(name.equals(spaces[i].getName()) return i; } return -1; }

public void consolidate( ) { Horse[] tmp = new Horse[ spaces.length ]; int loc = 0; for( Horse h : spaces) if( h != null ) { tmp[ loc ] = h; loc++; } spaces = tmp; }

© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content!

© A+ Computer Science - One question on the A test free response will require you to manipulate a 2-dimensional array or a GridWorld grid.

© A+ Computer Science int[][] mat = new int[3][3]; A matrix is an array of arrays

© A+ Computer Science - int size = 40; int[][] mat = {{5,7,9,2}, {5,3,4,6}, {7,0,8,9}}; int[][] intMat = new int[size][size]; //intMat is filled with zeros - 0s

© A+ Computer Science - String[][] words = new String[4][4]; //words is filled with null double[][] dMat = new double[3][3]; //dMat is filled with 0.0

© A+ Computer Science - int[][] mat = {{5,7,9,2,1,9}, {5,3,4}, {3,7,0,8,9}}; out.println(mat[2][1]); out.println(mat[1][2]); out.println(mat[0][3]); out.println(mat[2][4]); OUTPUT

© A+ Computer Science - int[][] mat = {{5,7,9,2,1,9}, {5,3,4}, {3,7,0,8,9}}; out.println(mat[7/4][0]); out.println(mat[1*2][2]); out.println(mat.length); out.println(mat[0].length); OUTPUT

© A+ Computer Science int[][] mat = new int[3][3]; mat[0][1]=2; A matrix is an array of arrays Which array? Which spot? 0 1 2

© A+ Computer Science mat[2][2]=7; mat[0][3]=5; mat[4][1]=

© A+ Computer Science - for( int r = 0; r < mat.length; r++) { for( int c = 0; c < mat[r].length; c++) { mat[r][c] = r*c; } if mat was 3x3

© A+ Computer Science - //start //stop //increment for(outer=1; outer<=2; outer++) { } OUTPUT //start //stop //increment for(int inner=1; inner<=2; inner++) out.println(outer + " " + inner); out.println(); OUTPUT int outer=1;

© A+ Computer Science int[][] mat = new int[3][3]; A matrix is an array of arrays # of array s size of each array

© A+ Computer Science - int[][] mat = {{5,7},{5,3,4,6},{0,8,9}}; out.println(Arrays.toString(mat[0])); out.println(Arrays.toString(mat[1])); OUTPUT [5, 7] [5, 3, 4, 6]

© A+ Computer Science - int[] nums = {1,2,3,4,5,6,7}; for(int r=0; r<nums.length; r++) { out.println(nums[r]); } OUTPUT length returns the # of elements/items/spots in the array!!!

© A+ Computer Science - for(int r=0; r<mat.length; r++) { } for(int c=0; c<mat[1].length; c++) { out.print(mat[1][c]); } out.println(); OUTPUT int[][] mat = {{5,7},{5,3,4,6},{0,8,9}}; for(int c=0; c<mat[r].length; c++) { out.print(mat[r][c]); } out.println(); OUTPUT

© A+ Computer Science - int[][] mat = {{5,7},{5,3,4,6},{0,8,9}}; for( int[] row : mat ) { for( int num : row ) { System.out.print( num + " "); } System.out.println(); } OUTPUT

© A+ Computer Science -

public int countWhitePixels() { int count = 0; for( int[] row : pixelValues ) { for( int item : row ) { if( item == 255 ) count++; } return count; }

public void processImage() { for( int r = 0; r < pixelValues.length-2; r++) { for( int c = 0; c < pixelValues[0].length-2; c++ ) { pixelValues[r][c] -= pixelValues[r+2][c+2]; if( pixelValues[r][c] < BLACK ) pixelValues[r][c] = BLACK; }

© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content!

© A+ Computer Science - ArrayList of References / Objects – get,set,remove,add,size – levels of abstraction Matrix / 2 D Array – nested loops, GridWorld ( grid ) GridWorld or Make a Class – location, actor, bug, critter, grid, super, abstract String / Array Question – find biggest, find smallest, etc.

© A+ Computer Science - -Read all 4 questions before writing anything -answer the easiest question 1 st -most times question 1 is the easiest -see if part B calls part A and so on -many times part C consists of A and B calls -write something on every question -write legibly / use PENCIL!!!!!!!!!! -keep track of your time

© A+ Computer Science - -When writing methods -use parameter types and names as provided -do not redefine the parameters listed -do not redefine the methods provided -return from all return methods -return correct data type from return methods

© A+ Computer Science - -When writing a class or methods for a class -know which methods you have -know which instance variables you have -check for public/private on methods/variables -return from all return methods -return correct data type from return methods

© A+ Computer Science - -When extending a class -know which methods the parent contains -have the original class where you can see it -make sure you have super calls -check for public/private on methods/variables -make super calls in sub class methods as needed

© A+ Computer Science - -When extending abstract / implementing interface -know which methods the parent contains -have the original class where you can see it -make sure you have super calls -check for public/private on methods/variables -make super calls in sub class methods as needed -implement all abstract methods in sub class

© A+ Computer Science - -When writing GridWorld question -use the GridWorld quick reference -use original method code when overidding -use Bug and BoxBug code if extending Bug -use Critter and ChameleonCritter code if extending Critter -use Critter and Bug for extends demo -use Critter for ArrayList and Math.random() demo -use GW quick reference on the entire AP test

© A+ Computer Science - Visit us at Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content!