Search Header Logo

Week-4 Repetition

Authored by Sudath Heiyanthuduwage

Computers

University

Used 67+ times

Week-4 Repetition
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the disadvantage of coding in one long sequence structure?

Duplicated code makes the program faster to write.

Writing a long sequence of statements is error prone.

If parts of the duplicated code have to be corrected, the correction has to be made many times.

It does not make use of decision structures.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of loop structure repeats the code a specific number of times?

Condition-controlled loop

Number-controlled loop

Count-controlled loop

Boolean-controlled loop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the values that the variable num contains through the iterations of the following for loop?

for num in range(2, 9, 2)

2, 3, 4, 5, 6, 7, 8, 9

2, 5, 8

2, 4, 6, 8

1, 3, 5, 7, 9

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The variable used to keep the running total is called a(n) _____.

Accumulator

Total

running total

grand total

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

_____ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a computation.

Input validation

Correcting data

Data validation

Correcting input

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The first input operation is called the _____, and its purpose is to get the first input value that will be tested by the validation loop.

priming read

first input

loop set read

loop validation

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When will the following loop terminate?

while keep_on_going != 999 :

When keep_on_going refers to a value less than 999

When keep_on_going refers to a value greater than 999

When keep_on_going refers to a value equal to 999

When keep_on_going refers to a value not equal to 999

Access all questions and much more by creating a free account

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

Already have an account?