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)

Computer Science Final Exam ACTUAL QUESTIONS AND CORRECT ANSWERS

Rating
-
Sold
-
Pages
11
Grade
A+
Uploaded on
02-05-2026
Written in
2025/2026

Computer Science Final Exam ACTUAL QUESTIONS AND CORRECT ANSWERS Consider the following code segment. Which of the following best describes the behavior of the code segment? - CORRECT ANSWER The code segment displays the value of 2(53)2(53) by initializing result to 2 and then multiplying result by 5 a total of three times. In the following procedure, assume that the parameter x is an integer. Which of the following best describes the behavior of the procedure? - CORRECT ANSWER displays true if x is negative and displays nothing otherwise. It Consider the following code segment, where exam and presentation are integer variables and grade is a string variable. IF((exam 90) AND (presentation 80)) { grade ← "A" } IF((exam 80) OR (presentation 75)) { grade ← "B" } ELSE { IF((exam 70) OR (presentation 60)) { grade ← "C" } ELSE { IF(exam 60) { grade ← "D" } ELSE { grade ← "F" } } } - CORRECT ANSWER When the value of exam is 80 and the value of presentation is 60

Show more Read less
Institution
Computer Science
Course
Computer Science

Content preview

Computer Science Final Exam ACTUAL
QUESTIONS AND CORRECT ANSWERS
Consider the following code segment.

Which of the following best describes the behavior of the code segment? - CORRECT
ANSWER The code segment displays the value of 2(53)2(53) by initializing result to 2 and
then multiplying result by 5 a total of three times.



In the following procedure, assume that the parameter x is an integer.

Which of the following best describes the behavior of the procedure? - CORRECT ANSWER It
displays true if x is negative and displays nothing otherwise.



Consider the following code segment, where exam and presentation are integer variables and grade is
a string variable.

IF((exam > 90) AND (presentation > 80))

{

grade ←

"A"

}

IF((exam > 80) OR (presentation > 75))

{

grade ←

"B"

}

ELSE

{

IF((exam > 70) OR (presentation > 60))

{

grade ←

"C"

}

ELSE

, {

IF(exam > 60)

{

grade ←

"D"

}

ELSE

{

grade ←

"F"

}

}

} - CORRECT ANSWER When the value of exam is 80 and the value of presentation is 60



The following code segment is used to determine whether a customer is eligible for a discount on a
movie ticket.

val1 ←← (NOT (category = "new")) OR (age ≥ 65)

val2 ←← (category = "new") AND (age < 12)

If category is "new" and age is 20, what are the values of val1 and val2 as a result of executing the
code segment? - CORRECT ANSWER val1 = false, val2 = false



Consider the following code segment.

What is displayed as a result of executing the code segment? - CORRECT ANSWER 100 300
500



Consider the following code segment.

Which of the following CANNOT be displayed as a result of executing the code segment? -
CORRECT ANSWER 1324



In the following procedure, the parameter max is a positive integer.

PROCEDURE printNums(max)

{

Written for

Institution
Computer Science
Course
Computer Science

Document information

Uploaded on
May 2, 2026
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.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

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.
STANFORDTOPGRADES Stanford University
Follow You need to be logged in order to follow users or courses
Sold
51
Member since
1 year
Number of followers
2
Documents
6685
Last sold
12 hours ago
TOPSELLER

Hi there! I'm dedicated to sharing my high-quality study guides and helpful EXAM Materials to make your learning easier and more efficient. All my materials are well-organized and tailored to help you ace your courses. I offer genuine and dependable exam papers that are directly obtained from well-known, reputable institutions as a highly regarded professional who specializes in sourcing study materials. Kindly don't hesitate to contact me, my study guides, notes and exams or test banks, are 100% graded and fully guaranteed

Read more Read less
4.2

6 reviews

5
3
4
1
3
2
2
0
1
0

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 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