Comp Sci unit 3 #8

Comp Sci unit 3 #8

11th Grade

10 Qs

quiz-placeholder

Similar activities

AP CSP Big Idea 3 Practice

AP CSP Big Idea 3 Practice

9th - 12th Grade

10 Qs

AP Computer Science Unit 2

AP Computer Science Unit 2

9th - 12th Grade

9 Qs

CSP Unit 2 Review

CSP Unit 2 Review

9th - 12th Grade

9 Qs

Code.org Unit 5 Test

Code.org Unit 5 Test

11th Grade

15 Qs

Comp Sci Unit 3.b

Comp Sci Unit 3.b

11th Grade

15 Qs

AP CSA Unit 1 & 2 Review

AP CSA Unit 1 & 2 Review

9th - 12th Grade

10 Qs

AP CS A Unit 6 Quiz PRACTICE

AP CS A Unit 6 Quiz PRACTICE

9th - 12th Grade

10 Qs

Comp Sci Unit 3 #7

Comp Sci Unit 3 #7

11th Grade

10 Qs

Comp Sci unit 3 #8

Comp Sci unit 3 #8

Assessment

Quiz

Computers

11th Grade

Easy

Created by

Nick Nessralla

Used 11+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An algorithm is intended to display the following output.

red red blue red red blue red red blue

Which of the following code segments can be used to display the intended output?

Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

A flowchart provides a way to visually represent an algorithm and uses the following building blocks.

BlockExplanationOvalThe start or end of the algorithmRectangleOne or more processing steps, such as a statement that assigns a value to a variableDiamondA conditional or decision step, where execution proceeds to the side labeled true if the condition is true and to the side labeled false otherwiseParallelogramDisplays a message

 

In the flowchart below, assume that j and k are assigned integer values.

 

Which of the following initial values of j and k will cause the algorithm represented in the flowchart to result in an infinite loop?

j = -5, k = 5

j = 0, k = 5

j = 5, k = 0

j = 5, k = -5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following program.

Which of the following describes the result of executing the program?

The program displays the sum of the even integers from 2 to 10.

The program displays the sum of the even integers from 2 to 20.

The program displays the sum of the odd integers from 1 to 9.

The program displays the sum of the odd integers from 1 to 19.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The code segment below is intended to display all multiples of 5 between the values start and end, inclusive. For example, if start has the value 35 and end has the value 50 , the code segment should display the values 35,40 45, , and 50. Assume that start and end are multiples of 5 and that start is less thanend .

Which of the following could replace <Missing Expression> in line 2 so that the code segment works as intended?


Media Image
Media Image
Media Image
Media Image

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

The following code segment is intended to remove all duplicate elements in the list myList. The procedure does not work as intended.

j ← LENGTH(myList)

REPEAT UNTIL(j = 1)

{

IF(myList[j] = myList[j - 1])

{

REMOVE(myList, j)

}

j ← j - 1

}

For which of the following contents of myList will the procedure NOT produce the intended results?

Select two answers.


[10, 10, 20, 20, 10, 10]

[30, 30, 30, 10, 20, 20]

[30, 50, 40, 10, 20, 40]

[50, 50, 50, 50, 50, 50]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

A biologist wrote a program to simulate the population of a sample of bacteria. The program uses the following procedures.

Code for the simulation is shown below.

hours ← 0

startPop ← InitialPopulation ()

currentPop ← startPop

REPEAT UNTIL ((hours ≥ 24) OR (currentPop ≤ 0))

{

currentPop ← NextPopulation (currentPop)

hours ← hours + 1

}

DISPLAY (currentPop - startPop)

Which of the following are true statements about the simulation?

  1. -The simulation continues until either 24 hours pass or the population reaches 0.

  2. -The simulation displays the average change in population per hour over the course of the simulation.

  3. -The simulation displays the total population at the end of the simulation.

I only

II only

III only

I and II

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following program code.

 

Which of the following best describes the result of running the program code?

The number 0 is displayed.

The number 6 is displayed.

The number 10 is displayed.

Nothing is displayed; the program results in an infinite loop.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?