Search Header Logo
CSDC101 Lecture 5 - C++ Control Structures - Part 1

CSDC101 Lecture 5 - C++ Control Structures - Part 1

Assessment

Presentation

Computers

University

Easy

Created by

Joshua Martinez

Used 5+ times

FREE Resource

52 Slides • 26 Questions

1

media

2

media

3

media

4

media

5

media

6

media

7

Fill in the Blank

Based on the audio clip in the previous slide, what diagram models the workflow of a program?

8

media

9

Multiple Choice

Which is TRUE about Selection Logic?

1

It is also known as the conditional structure

2

It involves only one condition

3

It is also known as a loop

10

media

11

Multiple Choice

Which of the following selection statements performs an action if the condition is true and performs a different action if the condition is false?

1

if statement

2

if else statement

3

switch statement

4

loop statement

12

Multiple Choice

Which selection statement is identified as the multiple selection statement?

1

if statement

2

if else statement

3

switch statement

4

loop statement

13

media

14

media

15

Multiple Choice

The body of which iteration statement below may be executed at least once?

1

while

2

do while

3

for

4

ranged-based for

16

media

17

media

18

media

19

Multiple Choice

Evaluate the expression below.

TRUE && FALSE

1

True

2

False

20

Multiple Choice

Evaluate the expression below.

FALSE && FALSE

1

True

2

False

21

media

22

Multiple Choice

Evaluate the expression below.

TRUE || FALSE

1

True

2

False

23

Multiple Choice

Evaluate the expression below.

FALSE || FALSE

1

True

2

False

24

media

25

Multiple Choice

Evaluate the expression below.

!TRUE

1

True

2

False

26

media

27

media

28

Let's practice operator precedence..​

29

Multiple Choice

Evaluate the logical expression below.

(5 > 2) && (10 <= 5)

1

True

2

False

3

Undefined

30

Multiple Choice

Evaluate the logical expression below.

!(6 == 6)

1

True

2

False

3

Undefined

31

Multiple Choice

Evaluate the logical expression below.

!(6 == 6) || (100>90)

1

True

2

False

3

Undefined

32

Multiple Choice

Evaluate the logical expression below.

!(6 == 6) || (100>90) && (7>=8)

1

True

2

False

3

Undefined

33

media

34

media

35

media

36

media

37

media

38

Multiple Choice

Question image

What is the output of code snippet?

1

x is greater than y

2

no output

3

x

4

y

39

Multiple Choice

Question image

What is the output of the code snippet?

1

x is greater than y

2

no output

3

x

4

y

40

media

41

media

42

media

43

media

44

media

45

Multiple Choice

Question image

What is the value of the variable largest after performing the code snippet?

1

0

2

100

3

45

4

No value

46

Multiple Choice

Question image

What is the value of the variable largest after performing the code snippet?

1

0

2

100

3

45

4

No value

47

media

48

media

49

media

50

media

51

media

52

media

53

media

54

Multiple Choice

Question image

If x is 5 and y is 10, what is the output of the code snippet?

1

$

2

#

3

No output

55

Multiple Choice

Question image

If x is 5 and y is 1, what is the output of the code snippet?

1

$

2

#

3

No output

56

media

57

media

58

media

59

media

60

media

61

media

62

Multiple Choice

Question image

if the value of final score is 100, what is the output of the code snippet?

1

You got A!

2

You got B!

3

You got C!

4

You got D!

5

You got F!

63

Multiple Choice

Question image

if the value of final score is 59, what is the output of the code snippet?

1

You got A!

2

You got B!

3

You got C!

4

You got D!

5

You got F!

64

media

65

media

66

media

67

media

68

media

69

media

70

media

71

media

72

media

73

media

74

Multiple Choice

Question image

What is the output of the switch statement?

1

code path executed for value 0

2

code path executed for value 2

3

code path executed for value 3

4

code path executed for default path

75

Multiple Choice

Question image

What is the output of the switch statement?

1

code path executed for value 0

2

code path executed for value 2

3

code path executed for value 3

4

code path executed for default path

5

None of the choices

76

​In this example, the correct output is

​code path executed for value 2

code path executed for value 3

​Why?

​Case 2 does not have a break statement. Thus, it will continue on the next case.

media

77

Poll

Rate the audio lecture in terms of difficulty to learn.

Very Easy

Easy

Medium

Difficult

Very Difficult

78

Open Ended

List down questions below if you have any.

media

Show answer

Auto Play

Slide 1 / 78

SLIDE