1/89
LIANG
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Hardware
tangible parts - parts of the computer systems
Software
programs- set of instructions
Hardware componenets
keyboard, mouse, display screen, printer, a processor and memory
The procesor
processes a programs instructions
simple instructions
its power is speed
memory
holds programs, data for the comp to process and the results of the processing
main memory
used to store the current program and the data the program is using, the results of intermediate calculations.
Usually measured in megabytes
Byte
a quantity of memory
Auxiliary memory
also secondary memory
disk rives, CD’s, DVDs and flashdrives
permanent
measured in gigabytes
bits
is either a 0 or 1
a byte consists of
8 bits
address
the numbered location that the byte resides in
all data is encoded how?
using 1s and 0s
what is the address when several bytes are needed
the first bytes address
files
large groups of bytes in auxiliary memory
files have names
RAM
temp memory (random access memory)
ROM
permanent memory (read only memory)
when files are organized they are called
directories or folders (java programs are stored in files)
program
a set of instructions for a computer to follow
following the instruction is called
running or executing
input
what the user puts in/the data needed to run the program
output
results produced with the input and set of instructions
what does the operating system do
Retrieves and starts program for you
high level languages
H = human. computers cant understand it
low level languages
this is the translated version from high level which computers can understand.c
compliers
translates the program from high to low level language.
can be expensive and very large to produce
the compiler on the high level language is called
source program
Java compiler
does not translate a java program into assembly language or machine language, instead it gets converted to byte-code
java byte code
can be translated into any machine language so any computer can read it.
interpreter
translates each byte code instruction
Most java programs today are executed using..
Just-in-time where byte code is compiled and saved for later use so it doesn’t have to be re-compiled.
portability of byte code
can be sent over the internet and used anywhere in the world making java suitable for internet applications.
Classes in programing
pieces of a program in javac
class loader
automatically connects the classes together
applications
Regular programs meant to be run on ur comp
applets
little applications meant to be sent to another location on the internet and run there
programmer
the person who writes the program
package
is a library of classes that have been defined already
the items inside the parentheses are called
arguments
variable
something that can be changed and stores data
Statement
instruction in the computer that ends with a semicolon
syntax
the grammar rules for programming.
IDE
integrated development environment
object
the instances of a class that are created to use the attributes and methods of a class
methods are called
actions
The three design principles of OOP
encapsulation, polymorphism and inheritance
encapsulation
hides internal interpretation (void stuff)
polymorphism
Same program can be used for other things in different context
inheritance
higher more inclusive; lower more exclusing (gets more specific as they go down)
algorithms
a means of performing an action
bug
an error in a program
three kinds of error
syntax, runtime and logic
syntax error
grammatical mystics like no semi colon or something (compiler catches it)
runtime error
errors that are detected when ur programing is running but not during compilation
Logic error
human detects it because incorrect output
value
the data stored by the variable
camelCase
the way variables are named
declaring
giving it a type like int/String/Double/Float/Char
class types
used for a class of objects and has both data and methods
Primitive type
simple, non decomposable values sucha s an individual number or individual character
Primitive types (more memory to less memory)
byte - short - int - long - float - double - char - boolean
identifier
a name of the variable
rules for identifiers
letters
digits (0-9)
the underscore character (_)
the first character cannot be a digit or capital
Keywords or reserved words
can’t be used in identifiers because they already have meaning
initialized
when a variable is declared but not given a value
import.java.util.Scanner
is used to get the users input
Scanner keyboard = new Scanner(System.in);
gives the scanner an obj so later on keyboard.nextLine(); can be used
e notation
this is during float and can also be imprecise
operands
+, -, *, /
precedence rules
first: +,-,!, ++, and --
second: *,/,%
third: + and -
double quote
\”
single quote
\’
backlash
\\
new line
\ n
carriage return
\ r
tab
\ t
javadoc comments
/** and */
lexicographic order
is similar to alphabetical order, but it is based on the order of the characters in the ASCII (and unicode) character set
.compareTo()
a negative number if first part precedes second part, 0 if they are equal and positive if second part precedes the first part
the exit method
used when a situation arises that makes continuing the program pointless. (System.exit(0))
Switch statements
basically an if-else statement on crack with colons
Break statement
after one case if you put break it won’t consider any of the other cases (break;)
Enumeration
lists the values a variable can have making it restrictive
while loop
isn’t always executed if the conditions don’t require it to
do-while loop
will run once even if conditions aren’t met
a loop that repeats without ever ending is called
infinite loop
For loop
executes a loop after a condition is met for a certain number of times
syntax for For loop
(initialization, condition, update)
continue statement
ends current loop iteration and begins the next one (continue;) recommended to avoid
assertion checks
something that says something about the state of the program