Mouse, keyboard, touchscreen,...
Input devices
Computers store information in a sequence of ____.
Bits
True or False:
Java is case-sensitive.
True
These are the three types of programming errors.
Syntax errors, Runtime errors, and Logic errors.
This is the subsystem that interconnects the components of a computer.
Bus
Number of bits in a byte.
8
This is a conventional Java class name.
a) myProgram
b) MyProgram
c) myprogram
d) My Program
b) MyProgram
public class Errors {
public static void main(String[] args) {
System.out.println(13 / 0);
}
}
Runtime error
Exception in thread "main" java.lang.ArithmeticException: / by zero
These are the three categories of programming languages.
Machine language, Assembly language, High-level language.
USB flash drives, floppy disks, hard drives,...
Storage devices
Every statement in Java ends with one of these.
;
public class Errors {
public static main(String[] args) {
System.out.println("Hello World!");
}
Syntax error
Main.java:2: error: invalid method declaration; return type required
public static main(String[] args) {
^
This is the difference between resolution and dot pitch.
Resolution: The number of pixels of the display device (monitor).
Dot pitch: The space between the pixels in millimeters.
This type of memory is said to be volatile.
Random Access Memory (RAM)
Not a Java keyword:
a) public
b) static
c) end
d) void
c) end
public class Errors {
public static void main(String[] args) {
System.out.print("100 degrees Celsius in Fahrenheit is: ");
System.out.println((9 / 5) * 100 + 32);
}
}
Logic error
Output will be "100 degrees Celsius in Fahrenheit is: 132"
These are a computer's six hardware components.
Storage Devices, Memory, CPU, Communication Devices, Input Devices, and Output Devices.
The minimum memory unit.
Byte
Describe the difference between print and println
println prints a line and then returns to a new line.
print does the same but doesn't go to a new line.
public class errors {
public static void main(string[] args) {
System.out.print("Here are examples of some common errors: ");
System.out.println(21 / 0);
System.out.print("75% of 100 is ");
System.out.println(100 * (3 / 4));
}
}
1. public static void main(string[] args) { - Syntax
2. System.out.println(21 / 0); - Runtime
3. System.out.println(100 * (3 / 4)); - Logic