Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

AP Computer Science A Unit 3 Progress Check MCQ Exam

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
30-07-2024
Written in
2023/2024

AP Computer Science A Unit 3 Progress Check MCQ Exam

Institution
AP COMPUTER SCIENCE
Course
AP COMPUTER SCIENCE

Content preview

AP Computer Science A Unit 3 Progress Check: MCQ Exam
Consider the following variable declarations and initializations.
int a = 2;
int b = 6;
int c = 3;
Which of the following expressions evaluates to false ? - Answer -D. a < b != c < b
Consider the following code segment.
boolean a = true;
boolean b = false;
System.out.print((a == !b) != false);
What is printed as a result of executing this code segment? - Answer -B. true
Consider the following expression.
(3 + 4 == 5) != (3 + 4 >= 5)
What value, if any, does the expression evaluate to? - Answer -A. true
Consider the following code segment.
int quant = 20;
int unitPrice = 4;
int ship = 8;
int total;
if (quant > 10)
{
unitPrice = 3;
}
if (quant > 20)
{
ship = 0;
}
total = quant * unitPrice + ship;
What is the value of total after this code segment has been executed? - Answer -C. 68
Consider the following code segment.
int a = 1;
int b = 0;
int c = -1; if ((b + 1) == a)
{
b++;
c += b;
}
if (c == a)
{
a--;
b = 4;
}
What are the values of a, b, and c after this code segment has been executed? - Answer -D. a = 1, b = 1, and c = 0
Consider the following code segment.
int m = 8;
int n = 3;
if (m + n > 10)
{
System.out.print(m + n);
}
if (m - n > 0)
{
System.out.print(m - n);
}
What, if anything, is printed as a result of executing the code segment? - Answer -D. 115
In the code segment below, the int variable temp represents a temperature in degrees Fahrenheit. The code segment is intended to print a string based on the value of temp. The following table shows the string that should be printed for different temperature ranges.
Temperature RangeString to Print31 and below"cold"32-50"cool"51-70"moderate" 71 and above"warm"
String weather;
if (temp <= 31)
{
weather = "cold";
}
else
{
weather = "cool";
}
if (temp >= 51)
{
weather = "moderate";
}

Written for

Institution
AP COMPUTER SCIENCE
Course
AP COMPUTER SCIENCE

Document information

Uploaded on
July 30, 2024
Number of pages
9
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Thumbnail
Package deal
AP Computer Science Exam Bundle
-
39 2024
$ 45.99 More info

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.
millyphilip West Virginia University
View profile
Follow You need to be logged in order to follow users or courses
Sold
2944
Member since
4 year
Number of followers
1961
Documents
45422
Last sold
1 day ago
white orchid store

EXCELLENCY IN ACCADEMIC MATERIALS ie exams, study guides, testbanks ,case, case study etc

3.6

554 reviews

5
240
4
88
3
104
2
32
1
90

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

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

Student with book image

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

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions