Search Header Logo
DCS1101 - Week 2 (Intro to CPP)

DCS1101 - Week 2 (Intro to CPP)

Assessment

Presentation

•

Computers

•

University

•

Easy

Created by

Yasmin Basiran

Used 8+ times

FREE Resource

24 Slides • 18 Questions

1

media

2

media

3

Take note of the words on the screen...

​

You have 30 seconds
media

4

Open Ended

Write down how many you can catch!

5

media

6

media

7

media

8

media

9

media

10

media

11

media

12

Hotspot

Which part of the code tells the compiler that the program has been run successfully?

13

Open Ended

What do you think will happen if you don't add #include<iostream> at the top?

14

media

15

media

16

media

17

media

18

media

19

Multiple Select

Select all the correct statements about variables based on the lesson.

1

A variable stores values used by the program

2

A variable must have a name, type, and value

3

A variable is used to display output to the user

4

A variable can only store numbers

20

media

21

media

22

Multiple Choice

Which of the following is a valid C++ variable name?

1
1variable
2
variable1
3
variable-name
4
variable!

23

Multiple Choice

Which variable name is valid in C++?

1

student name

2

studentName

3

student-name

4

student@name

24

Multiple Choice

A teacher is writing a program to take note of students. Which one is an appropriate variable name according to good programming practices?

1

x

2

a1

3

totalStudents

4

ts

25

Open Ended

What is a variable name you would write if you, the student, are storing the value of the total subjects taken in a course?

26

media

27

media

28

Multiple Choice

What is the result of 5 + 3 * 2?

1
9
2
11
3
10
4
8

29

Multiple Choice

What is the output of 7 % 3?

1
1
2
4
3
3
4
2

30

Multiple Choice

What is the value of 20 / 5 * 2?

1
8
2
4
3
10
4
6

31

Multiple Choice

What is the result of (6 + 4) / 2?

1
3
2
10
3
5
4
7

32

media

33

media

34

media

35

media

36

Multiple Choice

What is the main purpose of a program?

1
The main purpose of a program is to create graphics and animations.
2
The main purpose of a program is to store data in a database.
3
The main purpose of a program is to manage user accounts and permissions.
4
The main purpose of a program is to execute instructions to perform tasks or solve problems.

37

Multiple Choice

Which component is required to use cout in C++?

1

return 0;

2

int main()

3

string

4

#include <iostream>

38

Multiple Choice

What does using namespace std; allow us to do?

1

Write slower code

2

Avoid writing std:: before standard names

3

Include libraries

4

End the program

39

Multiple Choice

Which data type is best for storing a whole number?

1
float
2
boolean
3
string
4
integer

40

Multiple Choice

What does return 0; indicate in a C++ program?

1
It indicates successful completion of the program.
2
It represents a warning message.
3
It signifies the start of the program.
4
It indicates an error in the program.

41

Multiple Choice

Which is an example of good programming practice?

1
Using single-letter variable names
2
Hardcoding values in the code
3
Ignoring code comments and documentation
4
Using meaningful variable names

42

media
pattern-tertiary
media

Show answer

Auto Play

Slide 1 / 42

SLIDE