Praxis 5652 Computer Science Prep Mod 3 Output and Print Stateme

Praxis 5652 Computer Science Prep Mod 3 Output and Print Stateme

Professional Development

29 Qs

quiz-placeholder

Similar activities

AP CSA Unit 1&2 Test

AP CSA Unit 1&2 Test

8th Grade - Professional Development

25 Qs

ReactJS Online Test

ReactJS Online Test

Professional Development

25 Qs

Julia -  Quiz 1

Julia - Quiz 1

Professional Development

24 Qs

Salesforce Daily Quiz

Salesforce Daily Quiz

Professional Development

24 Qs

Artificial Intelligence

Artificial Intelligence

University - Professional Development

24 Qs

Printer and Scanner

Printer and Scanner

Professional Development

25 Qs

FCS_Finals Exam

FCS_Finals Exam

Professional Development

25 Qs

CS Quiz Test 2

CS Quiz Test 2

Professional Development

25 Qs

Praxis 5652 Computer Science Prep Mod 3 Output and Print Stateme

Praxis 5652 Computer Science Prep Mod 3 Output and Print Stateme

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

Brandon Milam

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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?


  1. apple
    bananapear

  1. applebanana
    pear

  1. apple
    banana pear

  1. 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)

  1. print (2 * (rate + 0.5))

  1. print (2 + rate * 0.5)

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

  1. print ( 42 * 1.0)

  1. print (“42 * 2 / 2”)

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

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?