
Praxis 5652 Computer Science Prep Mod 3 Output and Print Stateme

Quiz
•
Computers
•
Professional Development
•
Hard
Brandon Milam
FREE Resource
29 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following code segments would produce the following output:
max:
5
int max = 5
print max:
print 5
int max = 5
print “max:”
print max
int max = 5
print “max:” //AppendLineFeed
print max
int max = 5
print max:
print “5”
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
print ( “apple” ) //line break appended
print ( “banana” )
print ( “pear ” )
What is printed as a result of executing the code segment?
apple
bananapear
applebanana
pear
apple
banana pear
apple banana
pear
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment:
double rate 2.25
/* missing code */
Which of the following could replace /* missing code */ so the output is 5.0 ?
print (2 * rate + 0.5)
print (2 * (rate + 0.5))
print (2 + rate * 0.5)
It is not possible to replace the code and get an output of 5.0.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is output when the following code segment is run?
int rate -4
int irate 2
int sum rate * irate
int irate irate + 3
print (sum * 2)
sum*2
-16
-22
22
Answer explanation
Solution: sum get the value of rate * irate at the point it is assigned. It does not change when irate gets modified
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
. Which of the following statements would print 42 when executed? Select all that apply.
print ( 42 * 1.0)
print (“42 * 2 / 2”)
print (42)
print (“42”)
Answer explanation
a would print 42.0, b would print, as a text string, 42 * 2 / 2
c would print 42 (the integer) and d would print 42 (as a text string)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
print ("monkey ")
print ("giraffe ") //line break appended
print ("lion ") //line break appended
print ("cheetah ")
What is printed as a result of executing the code segment?
monkey
giraffe
lion
cheetah
monkey giraffe
lion cheetah
monkey giraffe
lion
cheetah
monkey giraffe lion cheetah
monkey
giraffe
lion cheetah
Answer explanation
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output when the following code is executed?
print (5 - 3) //line break appended
print ("5 - 3")
5 - 3
5 - 3
5 - 3
2
2
2
2
5 - 3
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
operation&mah

Quiz
•
7th Grade - Professio...
24 questions
tin học

Quiz
•
Professional Development
30 questions
Тест информатика №1

Quiz
•
Professional Development
30 questions
Java Programming Fundamentals

Quiz
•
Professional Development
30 questions
Quiz de Python: Decisão e Repetição

Quiz
•
Professional Development
25 questions
10Vd08

Quiz
•
Professional Development
25 questions
DIP IT Unit 29 31

Quiz
•
Professional Development
30 questions
Quiz 6.1

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade