Search Header Logo

Comp Sci Mid Quarter Review Quiz

Authored by Michael Kendall

Computers

9th - 12th Grade

Used 15+ times

Comp Sci Mid Quarter Review Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

What is an IF statement used for? Select all that apply.

Make True/ False decisions

To count user input

Select between options in a program

Repeat sections of code

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Write the code to test if num1 and num2 are the same.

if (num1 != num2):

if (num1 < num2):

if (num1 == num2):

if (num1 = num2):

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code:

x = 18

if (x > 18):

 print(1)

elif (x < 18):

 print(2)

else:

 print(3)


Which of the following will the code output?

1

2

3

4.

MULTIPLE SELECT QUESTION

2 mins • 1 pt

The following line is seeing if the variable name1 is equal to the string Bob. Select all options that would fix an error in the following code:


IF (name1 == Bob)

Add a : (colon) at the end of the line of code

Change Bob to "Bob"

Change IF to if

Remove the parentheses in the code

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

To test if a variable is between two numbers you would use:

and

!

else

or

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which of the following correctly tests if a number equals 90 or 100?

if (x == 90 and 100):

if (x == 90 and x == 100):

if (x == 90 or 100):

if (x == 90 or x == 100):

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

if (x > 40 and < 50):

The code above should be rewritten as:

The code is fine

if (50 > x or x > 40):

if (50 > x and > 40):

if (x > 40 and x < 50):

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?