Butula TVC DICT II Object Oriented programming Quiz

Butula TVC DICT II Object Oriented programming Quiz

University

10 Qs

quiz-placeholder

Similar activities

Types of branches

Types of branches

University

10 Qs

1.3 Quiz

1.3 Quiz

8th Grade - University

15 Qs

Microcontroller

Microcontroller

University

10 Qs

Logic

Logic

KG - Professional Development

12 Qs

Collaboration, Case Management & Interdisciplinary Teams

Collaboration, Case Management & Interdisciplinary Teams

University

13 Qs

Psych Research Methods Review

Psych Research Methods Review

12th Grade - University

9 Qs

Activity 3

Activity 3

University

10 Qs

Makeup Quiz 5

Makeup Quiz 5

University

14 Qs

Butula TVC DICT II Object Oriented programming Quiz

Butula TVC DICT II Object Oriented programming Quiz

Assessment

Quiz

Other

University

Medium

Created by

Andrew Wakoli

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

What is the purpose of decision-making statements in programming?

To define variables

To create loops in the program

To specify conditions for code execution

To execute code without conditions

2.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

What does the 'if' statement in C++ require?

A boolean expression and a loop

A boolean expression and one or more statements

A boolean expression and a single statement

Only a boolean expression

3.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

What will happen if the boolean expression in an 'if' statement evaluates to false?

The program will terminate

The code inside the 'if' block will execute

The code after the 'if' statement will execute

The 'else' block will execute

4.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

In an 'if...else' statement, what does the 'else' block do?

Is optional and can be omitted

Always executes regardless of the condition

Executes when the 'if' condition is true

Executes when the 'if' condition is false

5.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

What is the output of the following code if the input is -5? 'if (X > 0) { Z = X + 10; } else { Z = 2 * X + 50; }'

Z = 0

Z = 40

Z = -10

Z = 10

6.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

What does the switch statement allow a programmer to do?

Handle exceptions

Define functions

Create loops

Choose between multiple alternatives based on an expression

7.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

In the switch statement, what does the 'default' case represent?

A case that always executes

A case that executes if no other cases match

The last case in the switch

The first case in the switch

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?