Grades
Problem Solving
memory
ask questions
repetition
Programming Language
The mapping
memory = variables
repetition = loops
CPU
History of Languages
C++
JAVA
C#
JAVA
Java
Source
Code
Java
Source
Code
Java
Source
Code
Java
Byte
Code
MAC
JVM
compiler
Java
Byte
Code
PC
JVM
compiler
Java
Byte
Code
Android
JVM
compiler
JIT
interpreter
MAC
CPU
interpreter
PC
CPU
interpreter
ARM
CPU
VB
Source
Code
C#
Source
Code
compiler
MSIL
.NET
CA
JIT
CPU
VC++
Source
Code
COM/Active-X
Variables
type?
Primitive Types
bits
0s and 1s
byte is 8 bits
128 64 32 16 8
100 10 1
bits vs bytes
1 bit 0 or 1
1 byte = 8 bits
1 kb = 1024 bits
1 KB = 1024 bytes
1 mb = 1024 kb
1 MB = 1024 KB
1 gb = 1024 mb
1 GB = 1024 MB
1 tb = 1024 gb
1 TB = 1024 GB
100 Mbps
ASCII
8 bit - 0 to 255
UNICODE
boolean expression
<
>
<=
>=
==
!=
! - not
| - bitwise or
arithmetic operators
ask questions
repetition
loops
for loop
for(var_defs ; boolean-expr ; var_changes)
{
//zero or more statements
}
for(int i = 0 ; i < 1000 ; i = i + 1)
{
System.out.println(i);
}
//here
while loop
while(boolean-expression)
{
//body
}
do while loop
do
{
//body
}
while(boolean-expression);
Variable Scope
++ ops
int i = 0;
i++;
i = i + 1;
primitive vs object
methods
String
collection of char
- empty string
String s = hello;
h
String Methods
s = 1 2
100 10
3
1
10^2 10^110^0
3 -> 3
converts to int
true
stringToInt
isNumber
false
-5
throw exception
Character
Class Methods
Instance Methods
Context
non-static context
Polymorphism
String manipulation
123+5-7
StringTokenizer
0123456789ABCDEF
11 10 13
B A D
256 16 1
(256*11) + (16*10)+(1 * 13)
num = 110
num.charAt(2) -> 0
4
2 1
4 -> 4
2989
28/2
14/2
7/2
3/2
1/2
0
0
0
1
1
1
11100
2989/16
186/16
11/16
0
13 D
10 A
11 B
BAD
16
pointer
Passing Variables
array
new keyword
-10
100
ar
100
elephant
changeSomething(int[] ar)
1/2 + 1/4
4/8 + 2/8 = 6/8
3/4
Contact
michael.Litman@cuw.edu
262-353-6205