wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

FINAL_EXAM (CFP_122)

Total questions: 35

Worksheet time: 18mins

Name
Class
Date
1.

What is the correct syntax to output "Hello World" in C++?

a)

Console.WriteLine("Hello World");

b)

cout<<"Hello World");

c)

print("Hello World);

d)

System.out.println("Hello World");

2.

C++ is an alias of C#?

a)

TRUE

b)

FALSE

3.

How do you insert COMMENTS in C++ code?

a)

# This is a comment

b)

/*This is a comment

c)

/*/This is a comment

d)

//This is a comment

4.

Which data type is used to create a variable that should store text?

a)

Int

b)

Char

c)

Float

d)

String

5.

How do you create a variable with the numeric value 5?

a)

int x = 5

b)

double x = 5

c)

num x = 5

d)

x = 5

6.

How do you create a variable with the floating number 2.8?

a)

int x = 2.8;

b)

double x = 2.8;

c)

byte x = 2.8

d)

x = 2.8

7.

Which header file lets us work with input and output objects?

a)

#include<iosstream>

b)

#include<inputstr>

c)

#include<stream>

d)

#include<iostream>

8.

Which operator can be used to compare two values?

a)

<>

b)

==

c)

><

d)

=

9.

How do you start writing an if statement in C++?

a)

if (x > y)

b)

if x > y then:

c)

if x > y

d)

if x > y

10.

To declare a character in C++, define the variable type with:

a)

( )

b)

| |

c)

[ ]

d)

{ }

11.

How many Logical Operators we have in C++?

a)

4

b)

6

c)

5

d)

3

12.

How many Arithmetic Operators we have in C++?

a)

5

b)

4

c)

7

d)

6

13.

How many Comparison Operators we have in C++?

a)

9

b)

8

c)

6

d)

7

14.

Use the _________ statement to specify a block of code to be executed if the condition is false.

a)

if

b)

else

c)

ladder else if

d)

else if

15.

Use __________ statement to specify a block of code to be executed, if a specified condition is true

a)

else if

b)

ladder if

c)

else

d)

if

16.

Use ____________ statement to specify a new condition to test, if the first condition is false

a)

else if

b)

if

c)

else

d)

ladder else if

17.

A _________ statement allows us to execute a statement or group of statements multiple times

a)

while loop

b)

for loop

c)

loop

d)

do...while loop

18.

in this type of loop, the condition is evaluated first and if it returns true then the statements inside execute.

a)

while loop

b)

do...while

c)

for loop

19.

this type of loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.

a)

while loop

b)

do...while loop

c)

for loop

20.

this type of loop is similar to while loop

a)

for loop

b)

do...while loop

c)

nested loop

21.

how many types of loops we have in the C++ platform?

a)

4

b)

3

c)

5

22.

how many types of conditional statements we have in the C++ platform?

a)

6

b)

4

c)

5

23.

what is the function of these symbol ++ in loop statements?

a)

condition

b)

increment

c)

initialization

24.

A binary number is a number expressed in the____________ numeral system?

a)

1 and 0

b)

Base 2

c)

Radix 2

25.

How many symbols do we have in a HEXADECIMAL conversion?

a)

20

b)

16

c)

14

26.

What should be considered when designing an algorithm?

a)

If there is more than one way of solving the problem

b)

If the correct hardware is being used

c)

If the correct software is being used

27.

What are the two main ways that algorithms can be designed?

a)

Images or videos

b)

By hardware or software

c)

In pseudocode or as a flowchart

28.

What is pseudocode?

a)

A specific programming language that all computers use

b)

A way of describing a set of instructions in text form

c)

A diagrammatic representation of a set of instructions

29.

What is a flowchart?

a)

A flowchart is a text-based way of designing an algorithm

b)

If the correct hardware is being used

A flowchart is a specific programming language

c)

A flowchart is a diagram that represents a set of instructions

30.

What is the symbol for a decision in a flowchart?

a)

A parallelogram

b)

A circle

c)

A diamond

31.

Which of these is the correct symbol for a process in a flowchart?

a)

A diamond

b)

A parallelogram

c)

A rectangle

32.

How are symbols connected together in a flowchart?

a)

Symbols do not get connected together in a flowchart

b)

With lines and an arrow to show the direction of flow

c)

By numbers

33.

Which symbol is used for input and output in a flowchart?

a)

A parallelogram

b)

A diamond

c)

A circle

34.

How would a condition loop be created when writing pseudocode?

a)

With a WHILE loop or a REPEAT-UNTIL loop

b)

With a FOR loop

c)

With a WHILE loop

35.

When can algorithms be used?

a)

Only with computers

b)

To design a solution to any problem

c)

For programming