Intro to Computers & Java Flashcards

1
Q

Computer program

A

A sequence of instructions that is executed by a computer to perform a task or solve a problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Programming

A

The act of designing and implementing computer programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Algorithm

A

An unambiguous, executable set of instructions to perform a task or solve a problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Machine code

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Hardware

A

The physical equipment of a computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

5 major hardware components of a computer system

A
  • Central Processing Unit (CPU)
  • Main memory
  • Secondary memory
  • Input devices
  • Output devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Central processing unit (CPU)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The fetch/ decode/ execute cycle

A

The process of a CPU running a program.

  • Fetch - the Control Unit fetches the next instruction from main memory
  • Decode - the instruction is encoded in the form of a number so the Control Unit decides the instruction and generates an electronic signal
  • Execute - the signal is routed to the appropriate component of the computer such as the ALU, a disk drive or other device. The signal causes that component to perform an operation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Main memory / primary storage

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Memory address

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Secondary storage

A

Storage that can hold data for long periods of time and persists without electricity, e.g., a disk drive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Disk drive

A

The most common type of secondary storage. A device that stores data by magnetically encoding it onto a spinning circular disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Software

A

The programs that run on a computer. There are two general categories:

  1. Operating systems - a set of programs that manages the computer’s hardware devices and controls their processes
  2. Application software - programs that make the computer useful to the user such as word processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

High-level programming languages

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Common elements of programming languages

A
  • Key words - reserved words that have a special meaning in a programming language and therefore cannot be used as an identifier by the programmer
  • Operators - symbols that denote mathematical or logical operations such as + or &&
  • Punctuation
  • Identifiers - programmer defined names used to identify storage locations in memory and parts of the program that are created by the developer
  • Syntax - rules that define how to form instructions in a paritcular programming language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Compiler

A

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).

17
Q

Applets

A

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.

18
Q

Statements

A

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.

19
Q

Variable

A

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”).

20
Q

Syntax errors (AKA compile-time errors)

A

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).

21
Q

Two primary methods of programming

A
  1. Procedural - Programming languages that consist of sets of statements that, together, perform a set of tasks. For example, gather input from a user, manipulate data stored in memory, and perform calculations. In procedural programs data items are passed from one procedure to another. That is the data items that are separate from the procedures, which can lead to problems, since the procedures must be designed for specific types of data. When the structure of data changes, the procedures must be changed or they’ll break.
  2. Object Oriented Programming - Rather than creating procedures, this is focused on creating objects that contain data and procedures. The data is known as the object’s attributes while the procedures as known as methods.
22
Q

Encapsulation

A

The combining of data and code into a single object

23
Q

Java virtual machine (JVM)

A

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.

24
Q

Case sensitive language

A

A programming language in which car and Car would be two distinct variables. Java is a case sensitive language.

25
Q

Class

A

A programmer-defined data type; a template for creating objects. Every program must contain at least one Class.

26
Q

Method

A

An action performed by an object of a given class, implemented via a sequence of statements that has a name, may have parameter variables, and may return a value. A method can be invoked any number of times with different values for its parameter variables.

27
Q

Network

A

An interconnected system of computers and other devices.

28
Q

Main method

A

The method that is first called when a Java application executes and must be present for the program to run.

The method signature is:
public static void main(String[] args)

29
Q

Argument

A

A value supplied in a method call (as per the method’s parameters) or one of the values combined by an operator.

30
Q

String

A

A sequence of characters

31
Q

Run-time error

A

Errors that the compiler won’t find because the program is syntactically correct, but cause it to act differently than intended. Logical errors are examples of run-time errors as well as exceptions such as “division by zero.” It is the responsibility of the programmer to test the program to find and fix any run-time errors.

32
Q

Logic errors

A

An error in a syntactically correct program that causes it to act differently from its specification. That is, the program doesn’t produce the intended result. (A form of run-time error.)

33
Q

Exception

A

A class that signals a condition that prevents the program from continuing normally. When such a condition occurs, an object of the exception class is thrown.

34
Q

Portable

A

A program may be written on one type of computer and then run on a wide variety of computers with little to no modification. Java is highly portable since a compiled Java program can run on any computer that has a JVM.

35
Q

Library

A

A set of precompiled classes that can be included in programs

36
Q

Data hiding

A

The ability of an object to hide its data from code that’s outside the object. The data may only be accessed and changed by the object’s methods. This protects it from corruption.

37
Q

API (Application Programming Interface)

A

A code library for building programs.

38
Q

Integrated Development Environment (IDE)

A

A programming environment that includes an editor, compiler, and debugger.