WorksheetsMidterm Exam - CP201
Total questions: 50
Worksheet time: 43mins
Data sent from a Computer is called
Input
Output
Process
Yes
19
19
19
What does <= mean?
less than
greater than
less than or equal to
greater than or equal to
What is the only function all C++ programs must contain?
start()
system()
main()
program()
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
What does <= mean?
less than
greater than
less than or equal to
greater than or equal to
y = 3;
x = 5 * y;
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
In pseudocode or as a flowchart
By hardware or software
What are the two main ways that algorithms can be designed?
Images or videos
In pseudocode or as a flowchart
By hardware or software
What is pseudocode?
A way of describing a set of instructions in text form
A specific programming language that all computers use
A diagrammatic representation of a set of instructions
What is a flowchart?
A flowchart is a text-based way of designing an algorithm
A flowchart is a specific programming language
A flowchart is a diagram that represents a set of instructions
What is pseudocode?
A way of describing a set of instructions in text form
A specific programming language that all computers use
A diagrammatic representation of a set of instructions
What is the symbol for a decision in a flowchart?
A parallelogram
A diamond
A circle
What is important to remember when designing an algorithm?
whether to use a flowchart or pseudocode
the instructions are in the correct order
that it must be easy to read
A boolean is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
An integer is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
A real is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
A string is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
The best data type for an age is...
integer
real
string
boolean
The best data type for a name is...
integer
real
string
boolean
The best data type for an average is...
integer
real
string
boolean
Algorithm is a
Step by step procedure
difficult procedure
complex
hard steps
Flowchart are ____________________________ in nature.
Easy
Simple
Complex
Hard
______________________ is a pictorial representation of steps.
Algorithm
Flowchart
Connectors
Flowlines
(a) are used to connect the boxes.
We use different boxes in
steps
flowchart
algorithm
quiz
Flowcharts are from
Left
Right
Bottom
Top to bottom
Choose a right C Statement.
Loops or Repetition block executes a group of statements repeatedly.
Loop is usually executed as long as a condition is met.
Loops usually take advantage of Loop Counter
All the above.
What is the output of C Program.?
int main()
{
int a=5;
while(a >= 3);
{
printf("RABBIT\n");
break;
}
printf("GREEN");
return 0;
}
GREEN
RABBIT GREEN
RABBIT is printed infinite times
None of the above
What is the output of C Program.?
int main()
{
int a=25;
while(a <= 27)
{
printf("%d ", a);
a++;
}
return 0;
}
25 25 25
25 26 27
27 27 27
Compiler error
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
}
while(a <= 30);
return 0;
}
32
33
30
No Output
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
if(a > 35)
break;
}
while(1);
return 0;
}
No Output
32 33 34
32 33 34 35
Compiler error
