NEW
Font size
WorksheetsFINAL_EXAM (CFP_122)
Total questions: 35
Worksheet time: 18mins
What is the correct syntax to output "Hello World" in C++?
Console.WriteLine("Hello World");
cout<<"Hello World");
print("Hello World);
System.out.println("Hello World");
C++ is an alias of C#?
TRUE
FALSE
How do you insert COMMENTS in C++ code?
# This is a comment
/*This is a comment
/*/This is a comment
//This is a comment
Which data type is used to create a variable that should store text?
Int
Char
Float
String
How do you create a variable with the numeric value 5?
int x = 5
double x = 5
num x = 5
x = 5
How do you create a variable with the floating number 2.8?
int x = 2.8;
double x = 2.8;
byte x = 2.8
x = 2.8
Which header file lets us work with input and output objects?
#include<iosstream>
#include<inputstr>
#include<stream>
#include<iostream>
Which operator can be used to compare two values?
<>
==
><
=
How do you start writing an if statement in C++?
if (x > y)
if x > y then:
if x > y
if x > y
To declare a character in C++, define the variable type with:
( )
| |
[ ]
{ }
How many Logical Operators we have in C++?
4
6
5
3
How many Arithmetic Operators we have in C++?
5
4
7
6
How many Comparison Operators we have in C++?
9
8
6
7
Use the _________ statement to specify a block of code to be executed if the condition is false.
if
else
ladder else if
else if
Use __________ statement to specify a block of code to be executed, if a specified condition is true
else if
ladder if
else
if
Use ____________ statement to specify a new condition to test, if the first condition is false
else if
if
else
ladder else if
A _________ statement allows us to execute a statement or group of statements multiple times
while loop
for loop
loop
do...while loop
in this type of loop, the condition is evaluated first and if it returns true then the statements inside execute.
while loop
do...while
for loop
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.
while loop
do...while loop
for loop
this type of loop is similar to while loop
for loop
do...while loop
nested loop
how many types of loops we have in the C++ platform?
4
3
5
how many types of conditional statements we have in the C++ platform?
6
4
5
what is the function of these symbol ++ in loop statements?
condition
increment
initialization
A binary number is a number expressed in the____________ numeral system?
1 and 0
Base 2
Radix 2
How many symbols do we have in a HEXADECIMAL conversion?
20
16
14
What should be considered when designing an algorithm?
If there is more than one way of solving the problem
If the correct hardware is being used
If the correct software is being used
What are the two main ways that algorithms can be designed?
Images or videos
By hardware or software
In pseudocode or as a flowchart
What is pseudocode?
A specific programming language that all computers use
A way of describing a set of instructions in text form
A diagrammatic representation of a set of instructions
What is a flowchart?
A flowchart is a text-based way of designing an algorithm
If the correct hardware is being used
A flowchart is a specific programming language
A flowchart is a diagram that represents a set of instructions
What is the symbol for a decision in a flowchart?
A parallelogram
A circle
A diamond
Which of these is the correct symbol for a process in a flowchart?
A diamond
A parallelogram
A rectangle
How are symbols connected together in a flowchart?
Symbols do not get connected together in a flowchart
With lines and an arrow to show the direction of flow
By numbers
Which symbol is used for input and output in a flowchart?
A parallelogram
A diamond
A circle
How would a condition loop be created when writing pseudocode?
With a WHILE loop or a REPEAT-UNTIL loop
With a FOR loop
With a WHILE loop
When can algorithms be used?
Only with computers
To design a solution to any problem
For programming
