CC102 Midterm Ay2023 2024 - 1ST

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Republic of the Philippines

Catanduanes State University


College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

CC102 – COMPUTER PROGRAMMING 1


BS INFORMATION TECHNOLOGY 1___
MIDTERM EXAM 1st Semester / AY: 2023-2024

Name: ____________________________________ Score: ____________


Class Schedule (Time & Days): _______________ Date: _____________

TEST I – Multiple Choice. (15pts.)


Direction: Choose the letter that corresponds to the given sentence and encircle the letter of your choice. NO
ERASURE.
1. This refers to the language programmers use to develop software programs, scripts, or other sets of
instructions for computers to execute.
a. Programming Language c. Computer Programs
b. Source Code d. Computer Programming
2. Process of developing and implementing various sets of instructions to do a certain task.
a. Writing instructions c. Assembling
b. Compiling d. Programming
3. An engine that executes the java code, when java programs are compiled, the bytecode is generated.
a. Java Virtual Machine c. Java Runtime Environment
b. Java Development Kit d. Execution Engine
4. “javac” is short for?
a. Java Code c. Java Compiler
b. Java Console d. Java Class
5. It is a method in java program where the execution starts.
a. initialization() c. start()
b. main() d. execute()
6. It represents what kind of data you will store in a variable. It can be numeric, alphanumeric, decimal,
etc.
a. Data Type c. Source Code
b. Variable d. Integer
7. It is one of java technology that runs the codes compiled for JVM and performs class loading, code
verification and code execution.
a. Java Virtual Machine c. Java Runtime Environment
b. Java Development Kit d. Execution Engine
8. A software development environment which is used to develop Java applications and applets.
a. Java Virtual Machine c. Java Runtime Environment
b. Java Development Kit d. Execution Engine
9. A block of code that executes repeatedly based on certain conditions and are used to perform tasks
repeatedly in a certain amount of times.
a. Loops c. Conditional
b. Function d. Array
10. A set of instructions or code that will only execute if a certain condition is met.
a. Loops c. Conditional
b. Function d. Array
11. It contains human-readable notations that can be further converted to machine language using an
assembler.
a. Machine Language c. High-Level Language
b. Assembly Language d. Very High-Level Language
Republic of the Philippines
Catanduanes State University
College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

12. It is an implementation of an algorithm in the form of annotations and informative text written in plain
English.
a. Algorithm c. Flowchart
b. Pseudocode d. Annotations
13. Described as the blueprint of program during the program development, it uses graphical
representation to the solution of a problem.
a. Algorithm c. Flowchart
b. Pseudocode d. Annotations
14. It consists of the use of a series of English-like words that humans can understand easily to write
instructions. It is also called procedural language.
a. Machine Language c. High-Level Language
b. Assembly Language d. Very High-Level Language
15. A type casting used in converting a smaller type to a larger type size.
a. Converting c. Implicit Casting
b. Assignment d. Explicit Casting
TEST II – Fill in the Blanks. (10pts.)
Direction: For items 1 to 5, draw the symbol/shape being asked. For items 6 to 10, give the appropriate data
type for each declaration.

1. Input/output
2. Start
3. Process
4. Decision
5. Initialization/preparation
6. _________ name = "NAME";
7. _________ age = 20;
8. _________ value = 20.4f;
9. _________ letter = 'C';
10. _________ isActive = true;

Test III. Problem Solving.


III-A. Direction: From the given flowchart complete the table below and write all the printed output in the box
below. (11pts.)

N N <= 5 PRINT COMPUTE


2

OUTPUT:

Test III-B. Direction: Analyze the given code snippets and give the output. (9pts.)
CODE OUTPUT
Number 1. (3pts.)
public class Midterm {
Republic of the Philippines
Catanduanes State University
College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

public static void main(String[] args) {


double average = (95 + 96 + 93) / 3;
System.out.println("Average: " + (int) average);
}
}
Number 2. (3pts.)
public class Midterm {
public static void main(String[] args) {
int x = 25;
int y = x %= 3;
if (x > ++y) {
y += 2;
} else {
x += y;
}
System.out.println("RESULT: " + (x * y));
}
}

Number 3. (3pts.)
public class Midterm {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 5; j++) {
System.out.print(i * j + " ");
}
System.out.println();
}
}
}

Test III-C. (15pts.)

1. Draw a flowchart that will compute for the average of five inputted grades from different subject. If the
average is above 75 print “PASSED” otherwise “FAILED”. (5pts.)

2. Write a program that will compute for the average of five inputted grades from different subject. If the
average is above 75 print “PASSED” otherwise “FAILED”. (10pts.)

Prepared By:

JOSHUA R. VILLAFUERTE CESAR M. RAMIREZ, JR.


Instructor I Instructor I

ARNOLD T. MANLANGIT
Instructor I

Noted:

MARIA ANTONIA E. ROJAS, Ph.D


Republic of the Philippines
Catanduanes State University
College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

Department Chairperson,
Computing Programs
Republic of the Philippines
Catanduanes State University
College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

KEY TO CORRECTION
CC102 – COMPUTER PROGRAMMING 1
BS INFORMATION TECHNOLOGY 1___
MIDTERM EXAM 1st Semester / AY: 2023-2024

Test I. Multiple Choice:


1. A 9. A
2. D 10. C
3. A 11. B
4. C 12. B
5. B 13. C
6. A 14. C
7. C 15. C
8. B

Test II. Fill in the Blanks


1. 5.
6. String
2. 7. int
3. 8. float
9. char
10. boolean
4.

Test III-A.

N N <= 5 PRINT COMPUTE


N = 2+2 OUTPUT:
2 Y 2
N=4
N = 4 +2 24
4 Y 4
N=6
6 N

Test III-B.
1. Average: 94
2. RESULT: 6
3. 1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

Test III-C.
Republic of the Philippines
Catanduanes State University
College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

import
java.util.Sca
nner;
public class
Activity04 {
public
static void
main(String[
] args) {
Scanner
scan = new
Scanner(Syst
em.in);

System.out.
print("Enter
Grade 1: ");
double
g1 =
scan.nextInt
();

System.out.
print("Enter
Grade 2: ");

Prepared By:

JOSHUA R. VILLAFUERTE CESAR M. RAMIREZ, JR.


Instructor I Instructor I

ARNOLD T. MANLANGIT
Instructor I

Noted:
Republic of the Philippines
Catanduanes State University
College of Information and Communications Technology
Virac, Catanduanes
__________________________________________________________________________________________________

MARIA ANTONIA E. ROJAS, Ph.D


Department Chairperson,
Computing Programs

You might also like