NEW
Font size
WorksheetsComputer Science - Exam 1
Total questions: 15
Worksheet time: 8mins
The CPU is often referred to as the ________ of the computer because it retrieves instructions from memory and executes them.
Heart
Brain
Engine
Motherboard
Which statement about Random Access Memory (RAM) is correct
RAM provides permanent storage for programs and data
RAM is volatile and loses data when the computer is turned off
Reading from RAM is slower than reading from storage
RAM operates at 5 gigahertz (GHz)
What type of storage device is used for permanent data storage?
Motherboard
Central Processing Unit (CPU)
Radom Access Memory (RAM)
Solid State Drive (SSD)
Which of the following is an example of high-level programming language?
Binary
Assembly
Machine Language
Java
What is the purpose of a statement in Java?
To group blocks of code
To represent an action or command to the computer
To define a class
To describe an error message
In Java, the name of the file must match the name of the:
First statement in the program
Class name after the public class keyword
Package name in the code
Method name in main
Errors that occur when a programmer forgets a symbol or mistypes something in Java are called:
Logical errors
Runtime errors
Syntax errors
Execution errors
Which of the following is a primitive data type in Java:
String
Array
double
Object
Which of the following is a valid variable name in Java?
1st Value
public
myValue
$prive
What is the result of the following expression in Java?
( 45 % 6 ) + ( 8 / 3 ) * 2
7
10
11
12
What is true about indentifiers
must begin with lowercase letters (unless it is a class or constant)
case-sensitive (myVar and myvar are different)
reserved word (like int or boolean) cannot be used
can contain letters, digits, underscores (cannot use dollar signs)
all of the above
holds whole numbers
boolean
char
int
double
holds floating/fractional numbers
int
double
boolean
char
holds true or false
char
boolean
int
double
holds one (single) character
boolean
int
double
char
