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

DCS1101 - Week 1 (Intro to CPP)

Assessment

Presentation

•

Computers

•

University

•

Easy

Created by

Yasmin Basiran

Used 2+ times

FREE Resource

24 Slides • 22 Questions

1

media

2

media

3

Word Cloud

Name one thing you learnt yesterday

4

Take note of the words on the screen...

​

You have 30 seconds

media

5

Open Ended

Write down how many you can catch!

6

media

7

Fill in the Blank

A preprocessor directive in C++ is written using the symbol ___ at the beginning of the line.

8

media

9

Hotspot

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

10

media

11

media

12

Open Ended

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

13

media

14

media

15

media

16

media

17

media

18

media

19

media

20

media

21

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

22

media

23

media

24

Multiple Choice

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

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

25

Multiple Choice

Which variable name is valid in C++?

1

student name

2

studentName

3

student-name

4

student@name

26

Open Ended

After learning about C++ syntax and basic code, what questions do you still have or what would you like to explore further about programming in C++?

27

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

28

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?

29

media

30

media

31

Multiple Choice

What is the result of 5 + 3 * 2?

1
9
2
11
3
10
4
8

32

Multiple Choice

What is the output of 7 % 3?

1
1
2
4
3
3
4
2

33

Multiple Choice

What is the value of 20 / 5 * 2?

1
8
2
4
3
10
4
6

34

Multiple Choice

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

1
3
2
10
3
5
4
7

35

media

36

media

37

media

38

media

39

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.

40

Multiple Choice

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

1

return 0;

2

int main()

3

string

4

#include <iostream>

41

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

42

Multiple Choice

Which data type is best for storing a whole number?

1
float
2
boolean
3
string
4
integer

43

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.

44

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

45

Multiple Choice

Which of the following topics is NOT listed in the contents for the C++ introduction session?

1

The #include directive

2

Object-oriented programming

3

Variables and assignment statements

4

Arithmetic operators

46

media
media

Show answer

Auto Play

Slide 1 / 46

SLIDE