wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Computer Science - Exam 1

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

The CPU is often referred to as the ________ of the computer because it retrieves instructions from memory and executes them.

a)

Heart

b)

Brain

c)

Engine

d)

Motherboard

2.

Which statement about Random Access Memory (RAM) is correct

a)

RAM provides permanent storage for programs and data

b)

RAM is volatile and loses data when the computer is turned off

c)

Reading from RAM is slower than reading from storage

d)

RAM operates at 5 gigahertz (GHz)

3.

What type of storage device is used for permanent data storage?

a)

Motherboard

b)

Central Processing Unit (CPU)

c)

Radom Access Memory (RAM)

d)

Solid State Drive (SSD)

4.

Which of the following is an example of high-level programming language?

a)

Binary

b)

Assembly

c)

Machine Language

d)

Java

5.

What is the purpose of a statement in Java?

a)

To group blocks of code

b)

To represent an action or command to the computer

c)

To define a class

d)

To describe an error message

6.

In Java, the name of the file must match the name of the:

a)

First statement in the program

b)

Class name after the public class keyword

c)

Package name in the code

d)

Method name in main

7.

Errors that occur when a programmer forgets a symbol or mistypes something in Java are called:

a)

Logical errors

b)

Runtime errors

c)

Syntax errors

d)

Execution errors

8.

Which of the following is a primitive data type in Java:

a)

String

b)

Array

c)

double

d)

Object

9.

Which of the following is a valid variable name in Java?

a)

1st Value

b)

public

c)

myValue

d)

$prive

10.

What is the result of the following expression in Java?

( 45 % 6 ) + ( 8 / 3 ) * 2

a)

7

b)

10

c)

11

d)

12

11.

What is true about indentifiers

a)

must begin with lowercase letters (unless it is a class or constant)

b)

case-sensitive (myVar and myvar are different)

c)

reserved word (like int or boolean) cannot be used

d)

can contain letters, digits, underscores (cannot use dollar signs)

e)

all of the above

12.

holds whole numbers

a)

boolean

b)

char

c)

int

d)

double

13.

holds floating/fractional numbers

a)

int

b)

double

c)

boolean

d)

char

14.

holds true or false

a)

char

b)

boolean

c)

int

d)

double

15.

holds one (single) character

a)

boolean

b)

int

c)

double

d)

char