Skylight home

O Purchase online
O Order form

 


250 Multiple-Choice
Computer Science Questions
in Java

cover

e-Edition

Maria Litvin
Phillips Academy, Andover, Massachusetts

Gary Litvin
Skylight Software, Inc.

    Part# 978-0-9727055-J-E.  Copyright © 2008-2012 by Skylight Publishing.

    This downloadable e-edition includes MS Word files and a PDF file with questions and a PDF file with answers and solutions.  It is licensed for use on one campus.  $85.00 per school.


About This Book

This book offers Continental Mathematics League computer science contest questions from 1999 to 2008.  CML has been bringing us fun competitions in mathematics and computer science for many years.  The annual CML contest in computer science takes place every spring, shortly before the Advanced Placement exams.  It offers 25 challenging multiple-choice questions for 40 minutes.  The questions mostly stay within the range of the standard AP CS curriculum, but many of them add an unusual twist or turn, and it is very difficult to answer all of them correctly within the allotted time.  With the time limit removed, however, these questions offer a great opportunity to test your knowledge of the subject, fill in gaps, gain new insights, and get "heavy-duty" practice for the AP exam.

2001, Question 14:

In the ABBAB language the alphabet has only two letters. A string of letters (including one-letter strings) is a valid word, if and only if the isValid method returns true for that string. isValid is defined as follows:

    public boolean isValid (String word) { int n = word.length(); return n <= 1 || (isValid(word.substring(0, n-1)) && word.charAt(n-1) == 'B') || (isValid(word.substring(0, n-2)) && "BA".equals(word.substring(n-2))); }

How many valid words of length 7 are there in the ABBAB language?

(A)     2
(B)     3
(C)     15
(D)     23
(E)     34

Skylight Publishing
support@skylit.com