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

CSCI 1301 MIDTERM STUDY GUIDE QUESTIONS WITH 100% CORRECT ANSWERS

Rating
-
Sold
-
Pages
106
Grade
A+
Uploaded on
05-12-2025
Written in
2025/2026

CSCI 1301 MIDTERM STUDY GUIDE QUESTIONS WITH 100% CORRECT ANSWERS

Institution
CSCI 1301
Course
CSCI 1301











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

Written for

Institution
CSCI 1301
Course
CSCI 1301

Document information

Uploaded on
December 5, 2025
Number of pages
106
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Which of the following is not a valid expression? Assume x and y are integer variables.
A. x / (y * 7)
B. y / x * 2
C. 2x + 3y
D. (x - 3 * y)


Give this one a try later!


C. 2x + 3y

,Which statement is equivalent to the following?
if x == 1:
t = 'minute'
else:
t = 'minutes'


A. t='minute'+('s'ifx=1else")
B. t='minute'ifx!=1else'minutes'
C. t='minutes'ifx==1else'minute'
D. t='minute'ifx==1else'minutes'


Give this one a try later!


D. t='minute'ifx==1else'minutes'




For the given pseudocode, which XXX and YYY will output the sum of the input
integers (stopping when -1 is input)? Choices are in the form XXX / YYY.
val = Get next input
XXX


while val is not -1
YYY
val = Get next input


Put sum to output
A. sum=val/sum=val
B. sum=0/sum=sum+val
C. sum=0/sum=val
D. sum=val/sum=sum+val


Give this one a try later!

, B. sum=0/sum=sum+val




A programmer must write a 500 line program. Which is most likely the best approach?


A. Write 1 line, run and debug, write 1 more line, run and debug, repeat
B. Write 10-20 lines, run and debug, write 10-20 more lines, run and debug, repeat
C. Write 250 lines, run and debug, write 250 lines, run and debug
D. Write 500 lines, run and debug


Give this one a try later!


B. Write 10-20 lines, run and debug, write 10-20 more lines, run and debug,
repeat




What is output?
def calc(num1, num2):
return 1 + num1 + num2


print(calc(4, 5), calc(1, 2))
A. 145 112
B. 9 3
C. 4, 5, 1, 2
D. 10 4


Give this one a try later!


D. 10 4

, Given x = 1, y = 2, and z = 3, how is the expression evaluated? In the choices, items in
parentheses are evaluated first.


(x == 5) or (y == 2) and (z == 5)


A. False OR (True AND False) --> False OR False --> False
B. False OR (True AND False) --> False OR True --> True
C. (False OR True) AND False --> True AND False --> False
D. (False OR True) AND False --> True AND False --> True


Give this one a try later!


a. False OR (True AND False) --> False OR False --> False




Assume a and b are variables that hold the base and height of a right triangle. The
length of the long side (hypotenuse) is calculate as the square root of a^2 + b^2.
Which expression calculates the length of the hypotenuse?
A. math.square_root(aa+bb)
B. math.sqrt(math.pow(aa),math.pow(bb))
C. math.sqrt(math.pow(a,2)+math.pow(b,2))
D. math.pow(math.sqrt(a),2)+math.pow(math.sqrt(b),2)


Give this one a try later!


C. math.sqrt(math.pow(a,2)+math.pow(b,2))




What values are in result_set after the following code is run?
my_set = {1, 2, 3, 4, 5, 6}
other_set = {2, 4, 6}
result_set = my_set.union(other_set)

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.
TestITandFixIT Johns Hopkins University
View profile
Follow You need to be logged in order to follow users or courses
Sold
36
Member since
1 year
Number of followers
0
Documents
4737
Last sold
4 days ago

3.5

8 reviews

5
3
4
2
3
1
2
0
1
2

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

Frequently asked questions