100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

AP Computer Science A Final Exam Review UPDATED ACTUAL Questions and CORRECT Answers

Rating
-
Sold
-
Pages
28
Grade
A+
Uploaded on
09-12-2024
Written in
2024/2025

AP Computer Science A Final Exam Review UPDATED ACTUAL Questions and CORRECT Answers What is the data type of the following literal? "fooled you" - CORRECT ANSWER - string What is the camel case variable name for a variable that represents the top score? - CORRECT ANSWER - topScore

Show more Read less
Institution
AP Computer Science
Course
AP Computer Science










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
AP Computer Science
Course
AP Computer Science

Document information

Uploaded on
December 9, 2024
Number of pages
28
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

AP Computer Science A Final Exam Review
UPDATED ACTUAL Questions and
CORRECT Answers
What is the data type of the following literal?

"fooled you" - CORRECT ANSWER - string


What is the camel case variable name for a variable that represents the top score? - CORRECT
ANSWER - topScore


What are the three primitive data types that will be tested on the AP Exam? - CORRECT
ANSWER - double boolean int


What is the camel case variable name for a variable that represents a shoe size? - CORRECT
ANSWER - shoeSize


What data type should you use to represent the average grade for a course? - CORRECT
ANSWER - double



What data type should you use for a shoe size like 8.5? - CORRECT ANSWER - double



What data type should you use to record if it is raining or not? - CORRECT ANSWER -
boolean


What is the data type of the following literal?

'A' - CORRECT ANSWER - char



What data type holds true/false values? - CORRECT ANSWER - boolean

,What data type should you use to represent the amount of money in a bank account? -
CORRECT ANSWER - double


Which of the following is NOT the name of a Java primitive data type? - CORRECT
ANSWER - String



What are the two varieties of data in Java? - CORRECT ANSWER - objects and primitive


Which of the following is the correct header line for the main method in Java? - CORRECT
ANSWER - public static void main (String args [])



A ______ is a note written to a human reader of a program. - CORRECT ANSWER -
comment


Which of the following will result in an error? - CORRECT ANSWER - 12 + (13 + 7)/2 )
*4


What are the two steps that take place when an assignment statement is executed? - CORRECT
ANSWER - (i) Evaluate the Expression, and (ii) Store the value in the variable.


On a single line of code declare x, y, and z all to be an integer data type. - CORRECT
ANSWER - int x, y, z;



(2 - 6) / 2 + 9 - CORRECT ANSWER -7



Which of the following is legal? - CORRECT ANSWER - x=9


State what is printed.
int x = 40;
int y = 4;

, System.out.println(2 + 8 * y / 2 - x); - CORRECT ANSWER - -22


What is the value of the expression:

-5 * + 10 * - CORRECT ANSWER -1


On a single line of code declare x, y, and z to be double and on that same line initialize them all
to be 3.14. - CORRECT ANSWER - double x = 3.14, y = 3.14, z = 2.14;


State what is printed.
int a = 100;
int b = 200;
b/=a;

System.out.println(b + 1); - CORRECT ANSWER -3



What is another way to write p = p - 1;? - CORRECT ANSWER - p--;


The following code stores a 20 in the variable num;
double num = 61/3;
What small change can you make to this single line of code to make it produce the "real" answer
to the division? - CORRECT ANSWER - double num = (double) 61/3;


State what is printed.

System.out.println((double)(90/9)); - CORRECT ANSWER - 10.0


Write code that will calculate and print the square root of 435.61. - CORRECT
ANSWER - System.out.println(Math.sqrt(435.61));


Which of the following would return a random number from 1 to 6 inclusive? - CORRECT
ANSWER -

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1070
Member since
1 year
Number of followers
102
Documents
68976
Last sold
1 hour ago
MGRADES (Stanford Top Brains)

Welcome to MGRADES Exams, practices and Study materials Just think of me as the plug you will refer to your friends Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

169 reviews

5
73
4
30
3
44
2
8
1
14

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions