Midterm Exam - CPE104L-Programming Logic and Design
Midterm Exam - CPE104L-Programming Logic and Design
COLLEGE OF ENGINEERING
COMPUTER ENGINEERING DEPARTMENT
MIDTERM EXAM
In CPE 104L – Programming Logic and Design
2nd Semester, S.Y. 2021-2022
Name: ______________________________ Date:_____________________
Yr./ Sec: ____________________________ Score: _____________________
a. 1,2,3,4
b. 4,2,1,3
c. 1,2,4,3
d. 4,1,2,3
9. Which of the following is not a classification of algorithm according to structures?
a. Sequence
b. Branching
c. Loop
d. Decision Making
10. Which of the following is not a commonly used keywords in writing pseudocode for
input.
a. Input
b. Read
c. Set
d. Get
11. Which of the following is not a commonly used keywords in writing pseudocode for
output.
a. Display
b. Write
c. Print
d. prompt
12. This statement tells the compiler to include iostream file. This file contains pre defined
input/output functions that we can use in our program.
13. A namespace is like a region, where we have functions, variables etc and their scope is
limited to that particular region.
14. ___are just a text written by programmer during code development.
15. ____is the main function of our program and the execution of program begins with this
function, the int here is the return type which indicates to the compiler that this function
will return a integer value.
16. This statement returns value 0 from the main() function which indicates that the
execution of main function is successful. The value 1 represents failed execution.
17. _____is a type of diagram that represents an algorithm or process, showing the steps as
boxes of various kinds, and their order by connecting these with arrows.
18. A procedure for accomplishing some task which given an initial state, will terminate in a
defined end state.
19. ___ is an outline of a program, written in a form that can easily be converted in real
programming statements. It is an informal language that has no syntax rules and is not
meant to be compiled or executed.
20. ___is a schematic representation of a process.
21. A ___ is a region of the program and broadly speaking there are three places, where
variables can be declared.
22. An arrow in flowchart denotes ___.
23. This is represented as rectangles and used to show that something is performed.
24. Represented as circles, ovals, stadiums, or rounded rectangles which usually contain the
word "Start" or "End".
25. Represented as a diamond showing where a decision is necessary, commonly a Yes/No
question or True/False test.
26. The ___ is a keyword, but it is a compile-time operator that determines the size, in bytes,
of a variable or data type.
27. A shape represents that represents initiation in flow chart.
28. These type of variables holds integer value.
29. Data type that you can use to compute any mathematical operations and it has 4 bytes of
storage.
30. Data type that cannot be manipulated mathematically using standard arithmetic
operations.
31. Data type that you cannot use to compute any mathematical operations and it has 4 bytes
of storage.
32. Operation that perform familiar calculations on numeric values.
33. Division result is truncated or no rounding occurs.
34. In arithmetic operation order this is evaluated sixth
35. What is the value of x = 8 Or 4 ?
36. What is the value of x = 7 Xor 14 ?
37. ____ is the characteristic of a data element that describes whether it is numeric,
alphabetic or alphanumeric.
38. What is the value of x = Not 3 And 5 ?
39. Which of the following is not a relational operator? > != ! <
40. Copies string s1 into s2
a. strcpy(s2, s1)
b. strcpy(s1, s2)
c. strcopy(s1, s2)
d. strcopy(s2, s1)
41. Returns a pointer to the first occurrence of string s1 in string s2
a. strstr(s1, s2)
b. strstr(s2, s1)
c. strchr(s1, ch)
d. strchr(s2, ch)
91. – 95. Create a C++ program that allows the user to input his/ her grades in 5 subjects
and your program will compute the average grade and will display the equivalent grade.
96. – 100. Create a C++ program that will determine if the inputvalue (char or string) is
letter/word or number, if letter/word it will identify the first character if it is vowel or consonant,
and if the value is number, will identify if it is even or odd. You can use nested if-else
or nested switch case statements.