AP Computer Science A

Similar documents
AP Computer Science A

AP Computer Science A

AP Computer Science A

AP COMPUTER SCIENCE A 2010 GENERAL SCORING GUIDELINES

AP COMPUTER SCIENCE AB 2006 SCORING GUIDELINES

AP COMPUTER SCIENCE A 2006 SCORING GUIDELINES

Chief Reader Report on Student Responses:

Student Performance Q&A:

AP Computer Science A 2003 Scoring Guidelines

Student Performance Q&A:

AP Physics 2: Algebra-Based

ECE 122. Engineering Problem Solving with Java

Results from!the!2011 AP!Computer!Science A Exam Administration

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

Account joeacct = new Account (100, new Account (500)); Account joeacct = new Account (100, new Account (500, null));

Introduction to Programming Using Java (98-388)

CSC Java Programming, Fall Java Data Types and Control Constructs

Student Performance Q&A:

AP COMPUTER SCIENCE AB 2008 SCORING GUIDELINES

Prelim 2. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

CS313D: ADVANCED PROGRAMMING LANGUAGE

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

APCS Semester #1 Final Exam Practice Problems

TeenCoder : Java Programming (ISBN )

AP Computer Science Principles

AP Computer Science AB 2005 Scoring Guidelines

AP Computer Science A 2004 Scoring Commentary

Computer Sciences 302 Exam 2 Information & Sample Exam

AP PHYSICS B 2014 SCORING GUIDELINES

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

Inheritance and Interfaces

AP COMPUTER SCIENCE AB 2007 SCORING GUIDELINES

CS 3114 Data Structures and Algorithms DRAFT Project 2: BST Generic

Lecture 10 Declarations and Scope

calling a function - function-name(argument list); y = square ( z ); include parentheses even if parameter list is empty!

CS 6353 Compiler Construction Project Assignments

Java Fall 2018 Margaret Reid-Miller

Student Performance Q&A:

Lab5. Wooseok Kim

Review Chapters 1 to 4. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

CS 142 Style Guide Grading and Details

ECE 122. Engineering Problem Solving with Java

CS 251 Intermediate Programming Methods and Classes

CS 112 Programming 2. Lecture 10. Abstract Classes & Interfaces (1) Chapter 13 Abstract Classes and Interfaces

AP Computer Science AB 2007 Free-Response Questions

Prelim 2 Solutions. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Note that if both p1 and p2 are null, equals returns true.

AP Computer Science A

IMACS: AP Computer Science A

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Lecture 3 Tao Wang 1

Introduction to Visual Basic and Visual C++ Arithmetic Expression. Arithmetic Expression. Using Arithmetic Expression. Lesson 4.

PROGRAMMING FUNDAMENTALS

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011

SCHOOL OF COMPUTING, ENGINEERING AND MATHEMATICS SEMESTER 1 EXAMINATIONS 2015/2016 CI101 / CI177. Programming

CS111: PROGRAMMING LANGUAGE II

Cmpt 135 Assignment 2: Solutions and Marking Rubric Feb 22 nd 2016 Due: Mar 4th 11:59pm

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++

Computer Science II (20082) Week 1: Review and Inheritance

L o o p s. for(initializing expression; control expression; step expression) { one or more statements }

Welcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 8/19/ Review. Here s a simple C++ program:

Chapter 4: Conditionals and Loops

1 Lexical Considerations

CS 251 Intermediate Programming Methods and More

Chapter 10 Introduction to Classes

Problem Solving with C++

Compiler Theory. (Semantic Analysis and Run-Time Environments)

CSI33 Data Structures

Objects and Iterators

gcc o driver std=c99 -Wall driver.c bigmesa.c

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

CS 314 Midterm 2 Fall 2012

8*4 + 4 = 36 each int is 4 bytes

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

ECE 122. Engineering Problem Solving with Java

Absolute C++ Walter Savitch

Flow of Control. Flow of control The order in which statements are executed. Transfer of control

5/23/2015. Core Java Syllabus. VikRam ShaRma

Fundamentals of Programming Session 13

V2 2/4/ Ch Programming in C. Flow of Control. Flow of Control. Flow of control The order in which statements are executed

CS111: PROGRAMMING LANGUAGE II

Repetition Structures

Java Control Statements

CS313D: ADVANCED PROGRAMMING LANGUAGE. Lecture 3: C# language basics II

Makefiles Makefiles should begin with a comment section of the following form and with the following information filled in:

Computing Science 114 Solutions to Midterm Examination Tuesday October 19, In Questions 1 20, Circle EXACTLY ONE choice as the best answer

G Programming Languages - Fall 2012

Flowcharts [15 points]

CSE 1223: Exam II Autumn 2016

Computer Science E-119 Fall Problem Set 1. Due before lecture on Wednesday, September 26

The New C Standard (Excerpted material)

Welcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 1/9/ Review. Here s a simple C++ program:

7.1 Optional Parameters

2.8. Decision Making: Equality and Relational Operators

CSSE 220. Arrays, ArrayLists, Wrapper Classes, Auto-boxing, Enhanced for loop. Check out ArraysListPractice from SVN

Instantiation of Template class

Assignment 1: grid. Due November 20, 11:59 PM Introduction

Transcription:

2017 AP Computer Science A Sample Student Responses and Scoring Commentary Inside: RR Free Response Question 1 RR Scoring Guideline RR Student Samples RR Scoring Commentary 2017 The College Board. College Board, Advanced Placement Program, AP, AP Central, and the acorn logo are registered trademarks of the College Board. AP Central is the official online home for the AP Program: apcentral.collegeboard.org

AP COMPUTER SCIENCE A 2017 GENERAL SCORING GUIDELINES Apply the question assessment rubric first, which always takes precedence. Penalty points can only be deducted in a part of the question that has earned credit via the question rubric. No part of a question (a, b, c) may have a negative point total. A given penalty can be assessed only once for a question, even if it occurs multiple times or in multiple parts of that question. A maximum of 3 penalty points may be assessed per question. 1-Point Penalty v) Array/collection access confusion ([] get) w) Extraneous code that causes side-effect (e.g., printing to output, incorrect precondition check) x) Local variables used but none declared y) Destruction of persistent data (e.g., changing value referenced by parameter) z) Void method or constructor that returns a value No Penalty o Extraneous code with no side-effect (e.g., valid precondition check, no-op) o Spelling/case discrepancies where there is no ambiguity* o Local variable not declared provided other variables are declared in some part o private or public qualifier on a local variable o Missing public qualifier on class or constructor header o Keyword used as an identifier o Common mathematical symbols used for operators ( < > <> ) o [] vs. () vs. <> o = instead of == and vice versa o length/size confusion for array, String, List, or ArrayList; with or without ( ) o Extraneous [] when referencing entire array o [i,j] instead of [i][j] o Extraneous size in array declaration, e.g., int[size] nums = new int[size]; o Missing ; where structure clearly conveys intent o Missing { } where indentation clearly conveys intent o Missing ( ) on parameter-less method or constructor invocations o Missing ( ) around if or while conditions *Spelling and case discrepancies for identifiers fall under the No Penalty category only if the correction can be unambiguously inferred from context, for example, ArayList instead of ArrayList. As a counterexample, note that if the code declares int G=99, g=0;, then uses while (G < 10) instead of while (g < 10), the context does not allow for the reader to assume the use of the lower case variable. 2017 The College Board.

AP COMPUTER SCIENCE A 2017 SCORING GUIDELINES Question 1: Digits Part (a) Digits constructor 5 points Intent: Initialize instance variable using passed parameter Constructs digitlist Identifies a digit in num Adds at least one identified digit to a list Adds all identified digits to a list (must be in context of a loop) On exit: digitlist contains all and only digits of num in the correct order Part (b) isstrictlyincreasing 4 points Intent: Determine whether or not elements in digitlist are in increasing order Compares at least one identified consecutive pair of digitlist elements Determines if a consecutive pair of digitlist is out of order (must be in context of a digitlist traversal) Compares all necessary consecutive pairs of elements (no bounds errors) Returns true iff all consecutive pairs of elements are in order; returns false otherwise Question-Specific Penalties -2 (q) Uses confused identifier instead of digitlist 2017 The College Board.

Part (a) Digits constructor AP COMPUTER SCIENCE A 2017 SCORING GUIDELINES Question 1: Scoring Notes 5 points Points Rubric Criteria Responses earn the point if they... Responses will not earn the point if they... Constructs digitlist Identifies a digit in num Adds at least one identified digit to a list Adds all identified digits to a list (must be in the context of a loop) On exit: digitlist contains all and only digits of num in the correct order identify one digit of num or a length one substring/character of the String representation of num call add for some ArrayList using the previously identified digit, even if that digit was identified incorrectly call add for some ArrayList using previously identified digits, even if those digits were identified incorrectly add to digitlist even if it is not instantiated properly initialize a local variable instead of digitlist create an ArrayList<int> treat num itself as a String convert num to a String incorrectly add String or char to digitlist without proper conversion to the correct type identify only 1 digit obtain a list with the digits in reverse order omit one or more digits add extra digits mishandle edge case, e.g., 0 or 10 make a bounds error processing the String representation of num 4 points Part (b) isstrictlyincreasing Points Rubric Criteria Responses earn the point if they... Responses will not earn the point if they... Compares at least one identified consecutive pair of digitlist elements Determines if a consecutive pair of digitlist is out of order (must be in context of a digitlist traversal) Compares all necessary consecutive pairs of elements (no bounds errors) Returns true iff all consecutive pairs of elements are in order; returns false otherwise compare two consecutive Integers using compareto explicitly convert two consecutive Integers to ints and compare those with >=, <= etc. use auto-unboxing to convert two consecutive Integers to ints and compare those with >=, <= etc. determine the correct relationship between the two compared consecutive elements, even if the syntax of the comparison is incorrect compare consecutive pairs for inequality, but fail to consider the case when two elements are equal access digitlist as an array or string fail to call.get() compare using!> fail to consider the case where the two elements are equal for the false case return early return prematurely via if (...) return false; else return true; 2017 The College Board.

AP COMPUTER SCIENCE A 2017 SCORING GUIDELINES Question 1: Digits Part (a) public Digits(int num) { digitlist = new ArrayList<Integer>(); if (num == 0) { digitlist.add(new Integer(0)); } } while (num > 0) { digitlist.add(0, new Integer(num % 10)); num /= 10; } Part (b) public boolean isstrictlyincreasing() { for (int i = 0; i < digitlist.size()-1; i++) { if (digitlist.get(i).intvalue() >= digitlist.get(i).intvalue()) { return false; } } return true; } Note: The solutions shown above were written in compliance with the AP Java subset methods listed for Integer objects. Students were allowed to use the automatic "boxing" and "unboxing" of Integer objects in their solutions, which eliminates the need to use "new Integer(...)" in part (a) and "intvalue()" in part (b). These canonical solutions serve an expository role, depicting general approaches to solution. Each reflects only one instance from the infinite set of valid solutions. The solutions are presented in a coding style chosen to enhance readability and facilitate understanding. 2017 The College Board.

2017 The College Board.

2017 The College Board.

2017 The College Board.

2017 The College Board.

2017 The College Board.

2017 The College Board.

AP COMPUTER SCIENCE A 2017 SCORING COMMENTARY Question 1 Overview This question involves identifying and processing the digits of a nonnegative integer. The Digits class is used to store these digits in an ArrayList private instance variable. Students were asked to write the constructor of the Digits class and a method to determine if the stored digits of the number are in strictly increasing order. In part (a) students were asked to write a constructor that initializes the instance variable and fills it with all of the digits from the parameter num. Students must understand that the ArrayList instance variable must be instantiated before elements can be added. Students also needed to identify and isolate each digit of an integer value and add objects to an ArrayList in the correct order without going out of bounds. In part (b) students were asked to complete a boolean method that returns true if the stored digits in digitlist are in strictly increasing order; otherwise, it returns false. Students needed to demonstrate understanding of writing and evaluating boolean expressions and returning correct boolean values. Additionally, they needed to compare consecutive values in a list without going out of bounds. Sample: 1A Score: 9 In part (a) the response correctly instantiates the instance variable digitlist and also declares and instantiates a temporary list. The response correctly identifies all digits of num and adds them to the temporary list in reverse order, meaning the last digit of num is placed in the first position of the temporary list, the next to last digit of num is placed in the second position of the temporary list, and so on. Then the response iterates through the temporary list from the end to the beginning and adds each digit to the end of digitlist. On exit digitlist contains all and only digits of num in the correct order. Part (a) earned 5 points. In part (b) the logic correctly returns true when all consecutive pairs in digitlist are strictly increasing; otherwise it returns false. Part (b) earned 4 points. Sample: 1B Score: 4 In part (a) point 1 was not earned because the response does not instantiate the instance variable digitlist. The response correctly creates a String representation of num and then identifies one character of the string, which earned point 2. Point 3 was not earned because the response does not properly convert the identified character to an Integer before adding it to the list. The response earned point 4 for adding all digits to digitlist and earned point 5 for maintaining the order of the digits as they appear in the parameter num. Part (a) earned 3 points. In part (b) the response accesses digitlist as an array and, therefore, did not earn point 1. Point 2 was not earned because the response fails to consider the case where two elements are equal. Point 3 was not earned because of a boundary error when comparing all consecutive pairs. The response earned point 4 by counting the number of elements that were in increasing order and then comparing the count to the size of the list - 1. This technique can be used to show that all pairs are strictly increasing. Part (b) earned 1 point. 2017 The College Board.

AP COMPUTER SCIENCE A 2017 SCORING COMMENTARY Question 1 (continued) Sample: 1C Score: 3 In part (a) point 1 was not earned because the response does not instantiate the instance variable digitlist. Point 2 was not earned because the response incorrectly creates a String representation of num. Point 3 was not earned because the response does not properly convert the identified substring to an Integer before adding it to the list. The response earned point 4 by adding all identified digits to the list and did not earn point 5 because of a bounds error processing the String representation of num. Part (a) earned 1 point. In part (b) the response compares two consecutive elements of digitlist and earned point 1. Point 2 was not earned because the response fails to consider the case where two elements are equal. Point 3 was not earned due to a bounds error. Point 4 was earned because the logic correctly returns true when all consecutive pairs in digitlist are strictly increasing; otherwise it returns false. Part (b) earned 2 points. 2017 The College Board.