C++ : Selection

C++ : Selection

University

9 Qs

quiz-placeholder

Similar activities

Static routing

Static routing

University

10 Qs

SLG IPC Week 4

SLG IPC Week 4

University

12 Qs

HTML Basics

HTML Basics

University

12 Qs

Sains Komputer (Java) 2: Struktur Kawalan Pilihan

Sains Komputer (Java) 2: Struktur Kawalan Pilihan

10th Grade - University

10 Qs

C programming-1

C programming-1

University

13 Qs

Java Control Flow statements

Java Control Flow statements

University

10 Qs

[Repaso]: Fundamentos de Programación

[Repaso]: Fundamentos de Programación

University

13 Qs

Selectivas C++

Selectivas C++

University

10 Qs

C++ : Selection

C++ : Selection

Assessment

Quiz

Computers

University

Medium

Created by

ENNA NAWI

Used 11+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

The data type of the variable in the switch and value of a case must not be of the same type.

True

False

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

The _____ in switch statement is used to terminate the current sequence.

default

goto

break

jump

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

The default statement is optional and it can be used anywhere inside the switch statement.

True

False

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

We can have any number of case statements within a switch

True

False

5.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

What set of characters do you use to create a compound statement (block of code) in C++?

[ ]

( )

{ }

< >

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which one is the correct syntax for C++?.

if [ gross > 100000 ] then

net = gross - tax;

if ( gross > 100000 )

net = gross - tax;

if { gross > 100000 } then

net = gross - tax;

if < gross > 100000 > then

net = gross - tax;

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

What is printed by the following program segment?

HelloWorld!

Hello

Hello

World!

World!

8.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Based on the following program segment, what is the output when input code is 'B'?

applebanana

bananacarrotinvalid

banana

invalid

9.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following conditions is to test whether weight is in between 50 to 90?

if (weight > 50 && weight < 90)

if (weight < 50 && weight > 90)

if (weight > 50 || weight < 90)

if (weight < 50 || weight > 90)