AP Comp Sci

25
Name ________________________________________ AP Computer Science March 2013 Break Take Home Test Answer each question and bubble in the correct answer on your scantron. This completed scantron is due on April 1 st or whenever you return to school, whichever is first! The assignment is worth 100 points. A 20 point deduction will be taken for each day it is late. Be very careful with your scantron!! I’d even recommend answering the questions on a separate piece of paper first and then transferring to scantron when you are very sure of your answers. Questions begin on the next page…good luck!

description

Multiple Choice questions for AP Comp Sci

Transcript of AP Comp Sci

Page 1: AP Comp Sci

Name ________________________________________ AP Computer Science

March 2013 Break Take Home Test

Answer each question and bubble in the correct answer on your scantron. This completed scantron is due on April 1st or whenever you return to school, whichever is first! The assignment is worth 100 points. A 20 point deduction will be taken for each day it is late. Be very careful with your scantron!! I’d even recommend answering the questions on a separate piece of paper first and then transferring to scantron when you are very sure of your answers. Questions begin on the next page…good luck!

Page 2: AP Comp Sci

1)

2)

Page 3: AP Comp Sci

3)

Page 4: AP Comp Sci

4)

Page 5: AP Comp Sci

5)

6)

Page 6: AP Comp Sci

7)

Page 7: AP Comp Sci

8) A class period contains many students and a gifted student is a student. Three classes GiftedStudent, ClassPeriod and Student are declared to represent gifted students, class periods and students. Which of the following is most appropriate?

Page 8: AP Comp Sci

9)

10)

Page 9: AP Comp Sci

11)

12)

Page 10: AP Comp Sci

13)

Page 11: AP Comp Sci

14)

15) This question refers to the GridWorld Case Study. A FastCritter is to behave exactly like a Critter, except that it can move up to two grid locations in each direction (assuming that it is not blocked by another actor). To achieve this behavior, which method should be overridden?

Page 12: AP Comp Sci

16)

17)

Page 13: AP Comp Sci

18)

19) In the GridWorld Case Study if you want to create a HungryCritter class that is a subclass of Critter and a HungryCritter object eats everything that is not a Rock or Critter within 2 cells of its current location, what method or methods should you override?

Page 14: AP Comp Sci

20)

21)

Page 15: AP Comp Sci

22)

Page 16: AP Comp Sci

23)

24)

Page 17: AP Comp Sci

25)

26)

Page 18: AP Comp Sci

27) A track team needs to print a list of the practices times for each runner in the 100-meter dash. There are three runners, and each runner is measured four times. Given the following declaration:

Page 19: AP Comp Sci

28)

29)

Page 20: AP Comp Sci

30)

31)

Page 21: AP Comp Sci

32)

33)

Page 22: AP Comp Sci

34)

35)

Page 23: AP Comp Sci

36)

37)

Page 24: AP Comp Sci

38)

Page 25: AP Comp Sci

39)

40)