AP Computer Science Review Game

39 Questions | Total Attempts: 307

SettingsSettingsSettings
AP Computer Science Review Game - Quiz

Questions to help prepare for the midterm exam in AP Computer Science.


Questions and Answers
  • 1. 
    Which statement best describes a computer program? [Found in Quiz 1]
    • A. 

      A program can only perform one simple task.

    • B. 

      A program is a sequence of comments.

    • C. 

      A program can decide what task it is to perform.

    • D. 

      A program is a sequence of instructions and decisions that the computer carries out.

  • 2. 
    What translates high-level descriptions into machine code? [Appears on Quiz 1]
    • A. 

      Interpreter

    • B. 

      Linker

    • C. 

      Assembler

    • D. 

      Compiler

  • 3. 
    In Java, every statement must end with this symbol. [Appears on Quiz 1]
    • A. 

      ;

    • B. 

      )

    • C. 

      -

    • D. 

      !

  • 4. 
    What term is used to refer to a sequence of characters enclosed in quotation marks? [Appears on Quiz 1]
    • A. 

      Comment

    • B. 

      String

    • C. 

      Method

    • D. 

      Object

  • 5. 
    What is a term used to describe an error detected by the compiler that is a violation of the programming language rules? [Appears on Quiz 1]
    • A. 

      Logic error

    • B. 

      Typo

    • C. 

      Syntax error

    • D. 

      Run-time error

  • 6. 
    What term is used to refer to a sequence of steps for solving a problem that is unambiguous, executable, and terminating? [Appears on Quiz 1]
    • A. 

      Documentation

    • B. 

      Comments

    • C. 

      Pseudoprogram

    • D. 

      Algorithm

  • 7. 
    Which statement about identifiers is correct? [Appears on Quiz 1]
    • A. 

      Spaces are permitted inside identifiers.

    • B. 

      Identifiers are not case sensitive.

    • C. 

      Identifiers can be made up of letters, digits, and the underscore (_) character.

    • D. 

      Identifiers can use symbols such as ? or %.

  • 8. 
    What is the result of a % b when variables a and b are declared as follows: int a = 9; int b = 5;? [Appears in Chap 2 & 4 HW3]
    • A. 

      1.80

    • B. 

      4

    • C. 

      -80

    • D. 

      1

  • 9. 
    What is the term that means to put strings together to form a longer string? [Appears in Chap 2 & 4 HW3]
    • A. 

      Concatenation

    • B. 

      Casting

    • C. 

      Case

    • D. 

      Adding

  • 10. 
    What is an object? [Appears in Quiz 2]
    • A. 

      An entity in your program that is manipulated by calling methods.

    • B. 

      A sequence of instructions.

    • C. 

      Any input to a method.

    • D. 

      Any value stored in a variable.

  • 11. 
    Which of the following statements about methods is correct? [Appears in Quiz 2]
    • A. 

      A method is a sequence of instructions that accesses the data of an object.

    • B. 

      A method name is unique across the entire program.

    • C. 

      A method can be called on any object in any class.

    • D. 

      Methods are stored in variables.

  • 12. 
    The input to a method is called a(n) _______________. [Appears in Quiz 2]
    • A. 

      Parameter

    • B. 

      Interface

    • C. 

      Procedure

    • D. 

      Overloaded

  • 13. 
    What is the type of an object? [Appears in Quiz 2]
    • A. 

      Variable

    • B. 

      Method

    • C. 

      Reference

    • D. 

      Class

  • 14. 
    The output of a method is called its __________ value. [Appears in Quiz 2]
    • A. 

      Parameter

    • B. 

      Return

    • C. 

      Implicit

    • D. 

      Explicit

  • 15. 
    A _____________ is a collection of classes with a related purpose. [Appears in Quiz 2]
    • A. 

      Method

    • B. 

      Collection

    • C. 

      Package

    • D. 

      Import

  • 16. 
    What contains the instructions to initialize the instance variables of an object? [Appears in Chap 3 HW5]
    • A. 

      Initializer

    • B. 

      Access specifier

    • C. 

      Type name

    • D. 

      Constructor

  • 17. 
    The name of the constructor is always the same as the name of the __. [Appears in Quiz 3]
    • A. 

      Parameter variable

    • B. 

      Access specifier

    • C. 

      Class

    • D. 

      Instance variable

  • 18. 
    A local variable is a variable declared in the... [Appears on Quiz 3]
    • A. 

      Body of the class.

    • B. 

      Header of a class.

    • C. 

      Documentation comments.

    • D. 

      Body of a method.

  • 19. 
    A method is invoked on what type of parameter? [Appears on Quiz 3]
    • A. 

      Public parameter

    • B. 

      Private parameter

    • C. 

      Explicit parameter

    • D. 

      Implicit parameter

  • 20. 
    You should provide documentation comments for ___. [Appears on Quiz 3]
    • A. 

      Only classes

    • B. 

      Only methods with return values

    • C. 

      Only methods with parameters

    • D. 

      Every class, every method, every parameter, and every return value

  • 21. 
    In the statement below, amount is referred to as the ____ parameter. public void deposit(double amount) [Appears on Quiz 3]
    • A. 

      Private

    • B. 

      Implicit

    • C. 

      Public

    • D. 

      Explicit

  • 22. 
    A method header consists of these parts: __________________________ [Appears on Quiz 3]
  • 23. 
    There are 3 items specified in when a method is called.  Provide the order of those three items: __________________ [Appeasr on Exam 1]
  • 24. 
    Which statement is true about a Java program? [Appeasr on Exam 1]
    • A. 

      Java requires that at most one statement appear on one line.

    • B. 

      Java forces the programmer to use a particular layout for readability.

    • C. 

      Java is case sensitive.

    • D. 

      The first method that is executed in a Java program is called Main.

  • 25. 
    Which operator constructs object instances? [Appeasr on Exam 1]
    • A. 

      Instanceof

    • B. 

      Void

    • C. 

      Construct

    • D. 

      New

Back to Top Back to top