midterm 1 Flashcards
Computer Program
A sequence of instructions and decisions that tells a computer, in minute detail, how to fulfill a task.
Hardware
The collective physical computer and peripheral devices
Software
The programs the computer executes
Central Processing Unit (CPU)
Located at the heart of the computer, it performs program control and data processing.
Primary Storage
Storage made from memory chips—electronic circuits that can store data,
provided they are supplied with electric power.
Secondary Storage
usually a hard disk, it provides slower and less expensive storage that persists without electricity.
Networks
An entity of interconnected computers that allow a computer to read data and
programs from central storage locations or send data to other computers.
High-Level Programming Languages
Languages that specify the actions that a program should carry out.
Compiler
Translates the high-level instructions into more detailed instructions required by the
CPU.
Applets
Java code that can be located anywhere in the Internet.
Library
A collection of information that makes it possible to write portable programs that can
bypass proprietary operating systems. Java has a very large library
Java Virtual Machine (JVM)
A program that simulates a real CPU. Java programs are distributed as instructions for a virtual machine, making them platform-independent.
Integrated Development Environment (IDE):
A place where one can write and test programs.Integrated Development Environment (IDE): A place where one can write and test programs.
editor
A program that functions like a word processor made for entering and modifying text, such as a Java program
Class
The fundamental building blocks of Java programs; the class name must be the same as the file name and vice versa.
Method
Contains a collection of programming instructions that describe how to carry out a
particular task. Every Java application must have a main method.
argument
Any values the method needs to carry out its task.
string
A sequence of characters enclosed in quotation marks
- java Strings are immutable or constant. Once it is created, it can never be changed. o - Strings are NOT primitive types. String variables hold references to Strings, not the
actual character values. That means that two String variables can refer to the same, actual String object.
Compile-Time Error
Also known as a syntax error, it is a violation of the programming rules that is detected by the compiler
Run-Time Error
An error that causes a program to take an action that the programmer did not
intend. Sometimes called logic errors.
Exception
A run-time error so severe that the JVM sends an error message.
Ex.System.out.println(1 / 0);ERROR: “Division by Zero”
Pseudocode
An informal description of a sequence of steps for solving a problem.
Algorithm
A sequence of steps that is ambiguous, executable, and terminating.
variable
A storage location in a computer program with a name.
floating point numbers
A number type in Java that allows for fractional parts (such as in the number 0.335). The most commonly used type for floating-point numbers in Java is called double.
assignment statement
Stores a new value in a variable, replacing a previously stored value. o However, the reserved word “final” indicates that the value cannot be modified.
magic number
A numeric constant that appears in your code without explanation.
expression
The combination of variables, literals, operators, and/or method calls
modulus (mod)
The “%” operator, also known as the “remainder operator”. It executes the division
operator but stores the remainder value.
cast
an operator that converts number types to another number type.
prompt
A message that tells the user which input is expected.
PACKAGE
A collection of classes with a related purpose. All classes in the Java library are contained in packages.
Application Programming Interface (API)
Documentation that lists the classes and methods of the Java library.
string literals
Character sequences enclosed in double quotes, such as “Harry”.
concatenation
The + operator used to concatenate strings, that is, to put them together to yield a longer string.
escape sequence
Sequences that utilize the “backslash” or \
characters
‘h’ A value of the type char. Characters have numeric values.
character literals
Character sequences enclosed in single quotes, such as ‘Harry’.
relational operators
Operators that compare two values. (i.e. <, >, ==, >=, !=)
nested statement
When a statement is inside of another statement (e.g. an if statement within an if statement, a loop within a loop, or an if statement within a loop, etc.), it’s described as nested.
boolean operator
An operator that combines Boolean conditions.
o The Boolean type “boolean” has two values, false and true.
o Java has some Boolean operators that combine conditions like && (and) and || (or).