Image courtesy of Β Android Authority
βSTOP!β Before you look at the answers make sure you gave this practice quiz a try so you can assess your understanding of the concepts covered in unit 1. Click here for the practice questions:
AP Comp Sci A Unit 1 Multiple Choice Questions.
Facts about the test: The AP Computer Science A exam has 40 multiple choice questions and you will be given 90 minutes to complete the section. That means it should take you around 34 minutes to complete 15 questions.
*The following questions were not written by College Board and although they cover information outlined in the AP Computer Science A Course and Exam Description the formatting on the exam may be different.
1. Which of the following is not an example of hardware?
A. keyboard
B. operating system
C. monitor
D. chips
Answer: Hardware is physical and can be touched.
π Study AP Computer Science A, Unit 1.1: Unit 1 Overview
2. Programs and data are an example of which of the following:
A. CPU
B. hardware
C. ROM
D. software
Answer: This is the definition of software.
π Study AP Computer Science A, Unit 1.1: Unit 1 Overview
3.Β Which of the following is not an example of a secondary memory device?
A. Tapes
B. writable CD
C. RAM
D. floppy disk
Answer: A secondary memory device is removable and provides long-term storage.
4. Which of the following is not a function of an operating system?
A. provides the user interface with the computer
B. control all machine activity
C. give results for logical expressions
D. manages resources including CPU and memory
Answer: This is the definition of an operating system.
π Study AP Computer Science A, Unit 1.1: Unit 1 Overview
5. Which of the following is not an example of a browser?
A. monitor
B. text
C. executable program
D. graphics
Answer: Browsers include text, graphics, videos, sounds, audio, and executable programs.
6. Which kind of error is found by running the program and observing its behavior?
A. run-time error
B. compile-time error
C. logic error
D. syntax error
Answer: A logic error causes a program to take any action that the programmer did not intend, it can only be found by testing the program.
7. Assume that a and b have been defined and initialized as int values. The expression ! ( ! (a != b) && (b > 7) is equivalent to which of the following?
A. (a == b) || (b <= 7)
B. (a != b) && (b <= 7)
C. (a != b) || (b < 7)
D. (a != b) || (b <= 7)
Answer: ! = not, || = or, && = and
π Study AP Computer Science A, Unit 1.3: Expressions and Assignment Statements
8. Assume that the array has been defined & initialized as follows:
Answer: The answer is B.
π Study AP Computer Science A, Unit 1.4: Compound Assignment Operators
9. Which of the following replacements for /* missing code */ will cause the code segment to print only the values 1 3 5?
A. I only
B. I and III only
C. I and II only
D. I, II, and III
Answer: x not equal to 6 will not work, the others will.
π Study AP Computer Science A, Unit 1.5: Casting and Ranges of Variables
10. Assume that x & y are declared and initialized as int values. Consider the following expression below. Which of the following is equivalent to the given expression?
Answer: The answer is C. ! = not, || = or, && = and
π Study AP Computer Science A, Unit 1.3: Expressions and Assignment Statements
11. Given the following code segment, what are the values of var1 & var2 after the loop finishes?
A. var1=3, var2=-1
B. var1=0, var2=2
C. var1=1, var2=1
D. var1=2, var2=0
Answer: counting loop, increase var1 and decrease var2 until var2=0
π Study AP Computer Science A, Unit 1.5: Casting and Ranges of Variables
12. Given the following code segment, which of the following is this equivalent to?Β
A. if (x < 0) x=0; else x=-1
B. if (x > 0) x=-x; else x=0;
C. if (x > 0) x=0;
D. x=0;
Answer: Negate numbers greater than 0. Any negative numbers, or 0, change to 0.
π Study AP Computer Science A, Unit 1.3: Expressions and Assignment Statements
13. Which of the following expressions is equivalent to ! (c || d)
A. (!c) && (!d)
B. (c||d)
C. (c && d)
D. (!c) || (!d)
Answer: This question tests your knowledge of the Modus Tollens rule.
π Study AP Computer Science A, Unit 1.3: Expressions and Assignment Statements
14. Given the following code segment, what are the values of a and b after the loop finishes?Β
A. a=0, b=13
B. a=13, b=0
C. a=6, b=7
D. a=6, b=0
Answer: i is a counter loop, and the 3 columns change 6 times
π Study AP Computer Science A, Unit 1.5: Casting and Ranges of Variables
15. What data type should be used to represent the average grade for a course?
A. Boolean
B. int
C. string
D. double
Answer: Double represents a real, or decimal value.
What can we help you do now?
π€Connect with other students studying AP Comp Sci A with Hours