WorksheetsCF1 Hardware and Intro to Java
Total questions: 75
Worksheet time: 37mins
Name the data type that can store: "true"
boolean
char
String
double
Name the data type that can store: 1.0
double
int
char
boolean
(a) Name = 120;
(a) number = "12345";
(a) .out.println();
(a) name = "ARMY";
(a) number = 10;
Is the below program correct to print "Hello World"
True
False
What is the value of b after this code segment?
int a = 4;
int b = a++;
a = a * 2;
b /= 2;
2
4
5
8
What is the value of b after this code segment?
int a = 4;
int b = a++;
a = a * 2;
b /= 2;
2
4
5
8
int x = 4;
x *= 10;
Which is true?
x is now 40
x is now 10
x is still 4
x is now 14
int a = 5;
a--;
What is a now?
4
3
5
6
int a = 5;
a++;
What is a now?
4
7
5
6
int a = 7;
int b = 2 + a;
b = 9
b = 2
b = 7
b = 5
6 % 4
4
6
2
3
4 % 6
4
6
2
3
What will be the Output of the below code:
public class Demo{
public static void main(String[] args){
}
}
a) Nothing
b) Error
C) Finite
d) Hii
Which operator is used to add together two values?
(a)
How do you create a variable with a numeric value 5. where the name of the variable is x.
(a)
How do you write a Single Liner Comment in Java?
(a)
What is the correct syntax to output "HelloWorld" in Java?
(a)
The value of a string variable can be surrounded by single quotes.
true
false
Java is short for "JavaScript".
true
false
How do you insert COMMENTS in Java code?
# This is a comment
/* This is a comment
// This is a comment
How do you create a variable with the numeric value 5?
float x = 5;
x = 5;
int x = 5;
num x = 5
Which of the following primitive data type is a 1-bit and has only two values: true and false
char
string
int
boolean
True or False : Java is case sensitive, which means identifier Hello and hello would have different meaning in Java
True
False
What data type is classified as a sequenced of characters with double quotes.
Char
String
boolean
Float
It is an optional statement used to describe what a program or a line of program is doing.
tag
command
code
comment
Which of the followings is Java code that starts from the main() method as a mandatory part of every program
public void static main(String args [])
public void main static (args[] String)
public static void main (String args[])
public static void main [String [] Args]
Which of this command has errors? Select multiple
System.out.print("Hello World")
System.out.print(Hello World);
System.out.Print("Hello World);
System.out.print("Hello World");
Int data types represents _______ bits.
8
16
32
64
Main() method is not mandatory for a Java program
True
False
_________ operator returns the remainder after division
+
/
%
*
Which declaration will throw an error?
double num = 8;
int averageGrade = 89.7;
boolean done = false;
String done = "true";
A variable that holds true or false
String
boolean
int
float
Alex Trebek
A variable that holds words
String
boolean
int
float
A dictionary
Name the data type that can store: 5
int
char
String
None of the above
What prints out "I love Java" successfully?
System.out.println(I love Java);
Systemoutprintln("I love Java);
System.out.println("I love" + " Java");
System.out.println("I love Java")
What data type would you use for storing the number of students in a class?
boolean
String
double
int
What data type would you use for storing the average test score in a class?
double
String
int
char
What data type would you use for storing letter grades (without - or +) for students in a class?
String
char
int
boolean
What data type would you use to store names of students?
String
char
boolean
None of these
How would you declare and initialize a variable storing a person's name?
string name = "Jeff";
name String = "Jeff";
String name = Jeff;
String name = "Jeff";
How would you declare and initialize a variable storing the tax rate?
int taxRate = 5.1;
taxRate = "5.1";
double taxRate = 5.1;
double taxRate = "5.1";
The physical elements that make up a computer or electronic system and everything else involved that is physically tangible is called what?
Hardware
Software
Network
Extension
Which of the following are examples of hardware?
Keyboard
Plants vs Zombies
Monitor
Mouse
Which of the following is not an example of hardware?
It refers to the applications or programs you use while working on the computer.
Peopleware
Hardware
Software
What component helps draw air out of the computer case to prevent overheating?
Case Fan
Anti-Static Vacuum
Antifreeze
Aixiliary Fan
The component that is used to display the computer image on.
Video Card
RAM
Monitor
Windows
The device on which all of the major internal components are attached is called?
Hard Disk
ROM
Microprocessor
Motherboard
This component processes data if you want to see or record images.
Video Card
Microprocessor
Audio Card
CPU
This device allows a computer to maintain the time and date while unplugged or turned off
Motherboard battery
RAM
CPU
ROM
What does RAM stand for?
Read And Merge
Read Always Memory
Recent Accessed Memory
Random Access Memory
This storage device stores data permanently.
RAM Chip
ROM Chip
Hard Disk Drive
CPU
This is a type of temporary computer memory, what is it called?
ROM
Cloud
RAM
SSD
What does the heat-sink do?
Warms up water
Uses heat to get the CPU warmed up
Cools off the user
Cools off the CPU
Without this unit, the computer has no electricity to run. . .
Electric cables
Power Supply
IDE Cables
Fan
This device processes data so that you can hear or record sound
Video Card
RAM Chip
Sound Card
Speaker
This allow you to increase your computer's performance by adding additional components
Expansion slots
IDE Cables
Power Cables
Additional slots
This connector allows computers to transfer data to and from components outside of the computer
USB Port
External Port
Memory Port
Printer port
People who play video games or do graphic/3D design often will buy a higher end version of this
RAM
Hard Drive
CPU
Graphics Card
What is a SSD?
Flash Memory
Memory Stick
Hard Drive
Soft Drive
CPU stands for
Computer Processor Unit
Central Processing Unit
Collective Program URL
Computer Programming Unit
A computer hard drive
stores the operating system, applications, and data files such a documents, pictures and music that your computer uses.
is used to watch movies and videos
is an operating system like Windows or Linux
is not needed on a computer
This component allows you to use CDs, DVDs, and Blu-ray discs to listen to music or watch a movie
RAM
Hard drive
OS
Optical drive
Which type of memory, denoted RAM, stores values only when the power is on?
Regular Arbitrary Memory
Rarely Accessible Memory
Readily Accessed Memory
Random Access Memory
A reference to a specific memory location is called ___
an intersection
an address
a ZIP code
a box number
