Midterm Study Guide Flashcards
Algorithm Definition
A series of well-defined steps to generate the correct solution of a problem, should end in finite time.
Input
Anything from the user
Output
What is displayed by manipulating the input
Flowcharts
Visual representation used to document program logic. It is generally used for smaller problems.
Flow of data between steps is indicated by arrows or flowlines.
Pseudocode
Used to document program logic, typically used for larger and complex problems.
Statements are writen in simple English WITHOUT regard to the programming language.
Programlike statements written for humans.
Variable
Has an assigned name and value.
Major hardware components of a computer?
- The Central Processing Unit (CPU)
- Main Memory
- Secondary Storage Devices
- Input Devices
- Output Devices
What are the functions of the CPU?
- Determines where to get the next instruction
- Regulates the other major components of the computer with control signals.
- Performs the fetch, decode, excute cycle in order to process program information.
It is also referred to the brain of the computer
Clock (CPU)
A processor’s instructions execute at a rate govered by the processor’s clockes which ticks at a specific frequency.
1 GHz (1 billion ticks/second) = one billion instructions are executed in a second.
Main Memory
Also known as RAM
- Currently running programs
- Data used by those programs
- Used only for temporary storage
Memory is divided into sections that hold an equal amount of data
A section of a memory is called a byte
Byte is made up of 8 bits.
Secondary Storage Devices
Capable of storing information for longer periods on time (non-volatile)
Ex:
- Disk Drive
- External Drive
- CD drive
- Solid State Drive
- USB drive
- DVD drive
Input Devices
Any data the computer collects from the outside world.
- Keyboard
- Mouse
- Scanner
- Digital Camera
Output Devices
Any data the computer sends to the outside world.
The data is displayed on devices known as output devices.
Includes:
- Monitors
- Printers
Software
Programs that run on a computer
Two types of software:
- Operation Systems
- Application Software
Operating Systems
A set of programs that manages the computer’s hardaware devices and computer’s hardware devices and controls their processes
Ex:
- Unix
- Linux
- Mac OS
- Windows
Application Software
Programs that make the computer useful to the user. Provides a specialized type of the environment for the user to work in.
Ex:
- Spreadsheets
- Word Processors
- Games
Program Development Process
Text editor saves Java statements into the source code(.java) and is read by the Java compiler that produces Byte code (.class) and is interepreted by the Java Virtual Machince and Results in the Program Execution.
Primitive Data Types
byte
short
int
long
float
double
char
boolean
Numeric Data Types
byte
short
int
long
float
double
Escape Character
A two character sequence starting with \ that represents a special character
- Escape sequences also enable representing characters like ‘, “ , \
Ex:
\n = newline
\t = tab
' = single quote
" = double quote
\ = backslash
Basic Input
import java.util.Scanner; allows the program to get input
- Getting input is achieve by creating a Scanner object via:
Scanner scnr= new Scanner(System.in);
- Scanner scnr= new Scanner(System.in);
Arthimetic Operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo (remainder)
Logical Operators
Two binary logical operators:
&& (and) and || (or)
One urary logical operator to reverse the truth of a boolean expression:
! (not)