Barbara Ericson ericson@cc.gatech.edu AP CS Exam Overview Barbara Ericson ericson@cc.gatech.edu Georgia Institute of Technology.

Slides:



Advertisements
Similar presentations
Chapter 1 Object-Oriented Concepts. A class consists of variables called fields together with functions called methods that act on those fields.
Advertisements

Written by: Dr. JJ Shepherd
AbstractClassesInterfacesPolymorphism1 Abstract Classes, Interfaces, Polymorphism Barb Ericson Georgia Tech April 2010.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
COMS S1007 Object-Oriented Programming and Design in Java August 7, 2007.
Terms and Rules Professor Evan Korth New York University (All rights reserved)
Abstract Classes and Interfaces
Midterm Test Overview CS221 – 3/23/09. Test Curve Current median is a 71 or C- Median will be adjusted to an 81 or B- All test scores will be +10 on.
Abstract Data Types (ADTs) Data Structures The Java Collections API
Georgia Institute of Technology AP CS Exam Overview Barbara Ericson March 2005.
Information and Computer Sciences University of Hawaii, Manoa
What is inheritance? It is the ability to create a new class from an existing class.
MIS215 Module 0 - Intro 1 MIS 215 Module 0 Intro to Data Structures.
Programming With Java ICS Chapter 8 Polymorphism.
1 Java: AP Curriculum Focus and Java Subset Alyce Brady.
Inheritance - Polymorphism ITI 1121 Nour El Kadri.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
CSC1401 Classes - 2. Learning Goals Computing concepts Adding a method To show the pictures in the slide show Creating accessors and modifiers That protect.
COP 2800 Lake Sumter State College Mark Wilson, Instructor.
CreatingClasses-SlideShow-part31 Creating Classes part 3 Barb Ericson Georgia Institute of Technology Dec 2009.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
CSE 143 Lecture 4 More ArrayIntList : Pre/postconditions; exceptions; testing reading: slides created by Marty Stepp and Hélène Martin
Written by: Dr. JJ Shepherd
Announcements Final Exam: TBD. Static Variables and Methods static means “in class” methods and variables static variable: one per class (not one per.
A High Flying Overview CS139 – Fall 2006 How far we have come.
int [] scores = new int [10];
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Georgia Institute of Technology More on Creating Classes Barb Ericson Georgia Institute of Technology June 2006.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 17 – Specifications, error checking & assert.
Design issues for Object-Oriented Languages
Modern Programming Tools And Techniques-I
Object-Oriented Concepts
OOP: Encapsulation &Abstraction
Exceptions In this lecture:
Abstraction, Interface, Inheritance, Polymorphism, Override / Overload
CS 215 Final Review Ismail abumuhfouz Fall 2014.
Inheritance and Polymorphism
CSC 221: Computer Programming I Fall 2005
OBJECT ORIENTED PROGRAMMING II LECTURE 7 GEORGE KOUTSOGIANNAKIS
Agenda Warmup AP Exam Review: Litvin A2
CSE 374 Programming Concepts & Tools
CMSC202 Computer Science II for Majors Lecture 08 – Overloaded Constructors Dr. Katherine Gibson Based on slides by Chris Marron at UMBC.
Week 15 – Monday CS221.
CS139 – Fall 2010 How far we have come
Building Java Programs
Exception Handling Chapter 9.
CSC 113 Tutorial QUIZ I.
CISC124 Assignment 4 on Inheritance due next Monday, the 12th at 7pm.
Fall 2018 CISC124 12/3/2018 CISC124 or talk to your grader with questions about assignment grading. Fall 2018 CISC124 - Prof. McLeod Prof. Alan McLeod.
Workshop for CS-AP Teachers
Unit 3 Test: Friday.
Barb Ericson Georgia Institute of Technology Oct 2005
Building Java Programs
int [] scores = new int [10];
Fall 2018 CISC124 2/24/2019 CISC124 Quiz 1 marking is complete. Quiz average was about 40/60 or 67%. TAs are still grading assn 1. Assn 2 due this Friday,
Introduction to Data Structure
Barb Ericson Georgia Institute of Technology June 2005
Lecture 18: Polymorphism (Part II)
Overview of C++ Polymorphism
More on Creating Classes
EE 312 Final Exam Review.
Creating and Modifying Text part 3
TCSS 143, Autumn 2004 Lecture Notes
Barb Ericson Georgia Institute of Technology Oct 2005
CMPE212 – Reminders Assignment 2 due next Friday.
Java Basics Exception Handling.
Chapter 11 Inheritance and Encapsulation and Polymorphism
First Semester Review.
CS 240 – Advanced Programming Concepts
Presentation transcript:

Barbara Ericson ericson@cc.gatech.edu AP CS Exam Overview Barbara Ericson ericson@cc.gatech.edu Georgia Institute of Technology

Georgia Institute of Technology Learning Goals Understand the AP CS Exam What are the details of the exam? How is the exam graded? What is on the exam? Tips for taking the exam Resources to use in studying for the exam Georgia Institute of Technology

Georgia Institute of Technology Exam Details Two Sections (3 hour exam) 40 Multiple choice questions (1 hour 30 min) 5 answers to each question (a – e) Only one right answer At least 5 questions on the case study A Topics: oo, Java basics, cs terms, testing, design decisions AB Topics: data structures, big-O, and more design Free-response questions (1 hour 30 min) 4 questions (2-3 parts) A Topics: arrays, strings, classes, interfaces, sorting, searching, Java library classes, design AB Topics: 2-d arrays, data structures Georgia Institute of Technology

Georgia Institute of Technology How the Exam is Graded Total score is score = multipleChoiceWeight * (# correctAnswers – 0.25 * #wrongAnswers) + freeResponseWeight * freeResponseScore Equal weight to multiple choice and free response sections Each free response question is worth 9 points (partial credit can be given) Free response questions are graded according to a grading standard (rubric) by high school and college teachers Georgia Institute of Technology

Final Grade Calculation (1999) Max score 80 (1.00 * MC + 1.1111 * FR) AB Max Score 100 (1.25 * MC + 1.3889 * FR) Composite Score AP Grade 60-80 5 70-100 45-59 4 60-69 33-44 3 41-59 25-32 2 31-40 0-24 1 0-30 Georgia Institute of Technology

Georgia Institute of Technology Exam Hints Read the question before reading the code Do the easiest questions first If you read the question and have ruled out a couple of answers guess the answer Don’t write tricky, non-standard code If a question has parts answer the parts you can Don’t cross out what you have if you don’t add anything new Write neatly and indent properly Follow Java conventions for names and use good names Don’t worry about imports or comments Don’t forget the return statement Check and follow the pre and post conditions Georgia Institute of Technology

Primitive Variables vs Object Variables Primitive variables are like sliders Allocates space for the variable value The value can be between a min and max based on the amount of space Object variables are like a ticket to an event Help you find your seat ref Georgia Institute of Technology

Georgia Institute of Technology Object Variables Remember that declaring an object variable declares a reference to an object of that type It doesn’t create the object Example String s; // declares a reference s.length(); // throws a null pointer exception s = “Hello”; // now it references a string Georgia Institute of Technology

Inheritance versus Association “is a” versus “has a” Use inheritance when the child is really “a kind of” the parent A SlowFish “is a kind of” Fish A Truck “is a kind of” Vehicle Don’t use inheritance when the child can’t be substituted for the parent A Wall isn’t a kind of Fish A Vehicle isn’t a kind of Person Use “has a” when one object has an object of another class associated with it A Vehicle “has a” person associated with it (the owner) A course session “has a” course associated with it Georgia Institute of Technology

Georgia Institute of Technology Inheritance Test Which is correct? A high school is a kind of school? An exam is a kind of question? A marching band is a kind of school? A dictionary is a kind of book? A cat is a kind of animal? You must be able to substitute the child for the parent If I need a book will a dictionary do? If I need a school will a marching band do? Georgia Institute of Technology

Georgia Institute of Technology Inheritance You can call inherited public methods directly You can access inherited public fields directly You can access inherited private methods indirectly Through public methods You can access inherited private fields indirectly Through public accessors and modifiers Georgia Institute of Technology

Georgia Institute of Technology Inheritance Example public class ContactInfo { private String name; private String phoneNumber; public ContactInfo(String theName, String thePhoneNumber) this.name = theName; this.phoneNumber = thePhoneNumber; } public String getName() { return name; } public String getPhoneNumber() { return phoneNumber; } Georgia Institute of Technology

Inheritance Example - continued public class ExtendedContactInfo extends ContactInfo { private String nickname; public ExtendedContactInfo (String nickname, String name, String phoneNumber) // missing code } Georgia Institute of Technology

Inheritance Example - continued What can go in place of // missing code? super(theName,thePhoneNumber); this.nickname = theNickname; this.name = theName; this.phoneNumber = thePhoneNumber; this.nickname = theNickname; this.nickname = theNickname; super(theName, thePhoneNumber); this.nickname = theNickname; this.name = theName; this.phoneNumber = thePhoneNumber; This is question 39. Georgia Institute of Technology

Georgia Institute of Technology Inheritance The child class extends the parent class public class ChildClass extends ParentClass No extends means extends Object Objects of the child class inherit all the fields and methods of the parent class But can’t directly access private fields or methods Use public accessors and modifiers Can invoke parent constructor to initialize Use super(paramList) as first line in constructor If none found, one will be provided (no-arg) Georgia Institute of Technology

Georgia Institute of Technology Interfaces An interface is a way two classes can communicate without worrying about what class each one is. Just need to know the methods Let’s you plug in different classes As long as they implement the interface Interfaces can only have abstract methods and constants in them Declare an interface with public interface Name A class can implement more than one interface public class Name extends Parent implements Interface1, Interface2, … One interface can inherit from another Actionable inherits from Drawable in the revised case study Georgia Institute of Technology

Explaining Interfaces First point out what happens when you hardcode a class Like in MBCS with Fish Then show how interfaces let you add new classes Like Wall in the revised MBCS Georgia Institute of Technology

Georgia Institute of Technology Polymorphism Ability to call a method based on the type of the object the method In Java usually refers to inheritance-based Method is based on parent class All objects have a reference to their class All objects know what class they are All methods are invoked by checking with the class of the object first No matter what it is declared as Georgia Institute of Technology

Georgia Institute of Technology Polymorphism Example See ShapePanel A shape panel has a list of shapes ShapeCanvas has a list of shapes When we ask a shape to draw It first checks with it’s class to see if it has a draw method and if so will execute that So the correct shape is drawn If Oval draw an oval If Rectangle draw a rectangle Georgia Institute of Technology

Polymorphism Questions Expect questions on what is the output when a method is called on a child object that is declared as a parent object Remember that objects know what class they are And all methods are resolved starting with the object’s class then going up the inheritance tree Georgia Institute of Technology

Georgia Institute of Technology Static Static really means exists on the object that defines the class A class named Class Objects all have a reference to their class getClass() will return it Static variables are shared by all objects of a class Static methods can be called using ClassName.method() Static methods can’t access object fields No access to a current object (no this) Georgia Institute of Technology

Georgia Institute of Technology Run Time Exceptions NullPointerException, indicating an attempt to reference an object using an object variable that is null int[] gradeArray; System.out.println(gradeArray[0]); ArrayIndexOutOfBoundsException, indicating an attempt to access an element that is not within an array’s range of indexes gradeArray = new int[10]; System.out.println(gradeArray[10]); Georgia Institute of Technology

Georgia Institute of Technology Run Time Exceptions ArithmeticException, such as division by zero for integers System.out.println(9/0); ClassCastException, which occurs when an attempt is made to cast a variable to a class that it does not match List nameList = new ArrayList(); nameList.add(new Integer(5)); nameList.add(“Susan”); String name = (String) nameList.get(0); Students in AB should know how to throw exceptions like the IllegalArgumentException. Georgia Institute of Technology

Throwing Exceptions - AB IllegalArgumentException, indicating an argument to a method that is not legal for that method public void setUser(String user) { if (user.trim().equals("")) { throw new IllegalArgumentException("missing user name"); } else { this.user = user; } } Georgia Institute of Technology

Georgia Institute of Technology Summary The A Exam covers Basics: variables, loops, conditionals Debugging: Runtime exceptions, types of errors, techniques OO concepts: classes, objects, encapsulation, information hiding, interfaces, inheritance CS concepts: sorting, searching, algorithms, numbers in different bases, one-dimensional arrays, pre- and post- conditions, assertions Georgia Institute of Technology

Georgia Institute of Technology Summary The AB exam covers Data Structures Two-dimensional arrays, linked lists, stacks, queues, trees, heaps, priority queues, sets, maps Algorithms Big-Oh notation, worst-case and average-case time and space analysis Searching using hashing Sorting using quicksort and heapsort. Invariants Georgia Institute of Technology