Computer program
A sequence of instructions that is executed by a computer to perform a task or solve a problem.
Programming
The act of designing and implementing computer programs.
Algorithm
An unambiguous, executable set of instructions to perform a task or solve a problem.
Machine code
The only instructions that can be processed by a CPU; a stream of binary numbers (1s and 0s). Note, each type of CPU has its own machine language.
Hardware
The physical equipment of a computer.
5 major hardware components of a computer system
Central processing unit (CPU)
The heart of the computer that executes the machine instructions.
It is comprised of a Control Unit and the Arithmetic and Logic Unit (ALU). The Control Unit coordinates all of the computer’s operations. It is responsible for determining where to get the next instruction and regulating the other major components of the computer with control signals. The ALU performs mathematic operations. To run a program it follows a fetch/ decode/ execute cycle.
The fetch/ decode/ execute cycle
The process of a CPU running a program.
Main memory / primary storage
Commonly known as random access memory, or RAM, this is a device that holds information. Specifically, RAM holds the sequences of instructions in the programs that are running and the data those programs are using. RAM is usually a volatile type of memory, used only for temporary storage. When the computer is turned off, the contents of RAM are erased.
Memory address
RAM is divided into sections, known as bytes. Each byte is comprised of 8 switches, or bits. Each byte is given an unique number known as an address and all addresses are ordered from lowest to highest like PO Boxes.
Secondary storage
Storage that can hold data for long periods of time and persists without electricity, e.g., a disk drive.
Disk drive
The most common type of secondary storage. A device that stores data by magnetically encoding it onto a spinning circular disk.
Software
The programs that run on a computer. There are two general categories:
High-level programming languages
A programming language that provides an abstract view of a computer and allows programmers to focus on their problem domain by specifying the overall actions that the program should carry out without having to specify CPU instructions.
Common elements of programming languages
Compiler
A program that translates source code from a high-level programming language into an executable form (i.e. the more detailed machine language required by the CPU, such as bytecode for the JVM).
Applets
Contrary to an application, which is a standalone program that runs on your computer, an applets is a small application that executes inside a web browser. They are important because they extend the capabilities of HTML by performing mathematical calculations and interacting with the user.
Statements
A syntactical unit in a program (e.g. a complete instruction that causes the computer to perform some action). In Java a statement is either a simple statement, a compound statement, or a block.
Variable
The most fundamental way that a Java stores an item of data in memory is with a variable, or named storage location in the computer’s memory. The data stored in a variable may change while the program is running (hence the name “variable”).
Syntax errors (AKA compile-time errors)
When the compiler translates code into executable form, it uncovers syntax errors in the program. These are errors that the programmer made that violate the rules of the programming language. (i.e. an instruction that does not follow the programming language rules and is rejected by the compiler).
Two primary methods of programming
Encapsulation
The combining of data and code into a single object
Java virtual machine (JVM)
A program that simulates a CPU by reading Java byte code and executing them as they’re read. For this reason, the JVM is often called an interpreter. It’s also what makes Java so portable.
Case sensitive language
A programming language in which car and Car would be two distinct variables. Java is a case sensitive language.