Computer Science 1: CPS109 With Prof. Kosta Derpanis
Computer Science 1: CPS109 With Prof. Kosta Derpanis
Computer Science 1: CPS109 With Prof. Kosta Derpanis
COMPUTER SCIENCE 1
with Prof. Kosta Derpanis
Part 1
CPS109
COMPUTER SCIENCE 1
with Prof. Kosta Derpanis
Part 1
Administration
tinyurl.com/RU-N
ONO
Administration
m / C P S 1 0 9 - F 2 0 1 7
tinyurl.co
o o k
x t b
Te
, B i g Java : L ate O bj ec t s
H o rs t m a nn
LECTURE TOPICS
LECTURE TOPICS
Data types
LECTURE TOPICS
Data types
Variables
LECTURE TOPICS
Data types
Variables
Arithmetic expressions
Binary Representation
Binary Representation
Internal
Represen
tation
1 0 1 0 1 1 1 1
Internal
Represen
tation
bit (0 or 1)
1 0 1 0 1 1 1 1
Internal
Represen
tation
bit (0 or 1)
1 0 1 0 1 1 1 1
byte (group of 8 bits)
10100011
00001000
11001100
10001100
10001101
11001101
00101010
10001100
2052 10100011
2053 00001000
2054 11001100
2055 10001100
Byte address 2056 10001101
2057 11001101
2058 00101010
2059 10001100
2052 10100011
2053 00001000
2054 11001100
2055 10001100
Byte address 2056 10001101
2057 11001101
2058 00101010
2059 10001100
Binary
System
Decimal 0 1 2 3 4 5
Binary
System
Decimal 0 1 2 3 4 5
Binary
Binary
System
Decimal 0 1 2 3 4 5
Binary 0
Binary
System
Decimal 0 1 2 3 4 5
Binary 0 1
Binary
System
Decimal 0 1 2 3 4 5
Binary 0 1 10
Binary
System
Decimal 0 1 2 3 4 5
Binary 0 1 10 11
Binary
System
Decimal 0 1 2 3 4 5
Binary 0 1 10 11 100
Binary
System
Decimal 0 1 2 3 4 5
Decimal 0 1 2 3 4 5 6 7 8 9
Hexadec
imal
System
Decimal 0 1 2 3 4 5 6 7 8 9
Hexadecimal
Hexadec
imal
System
Decimal 0 1 2 3 4 5 6 7 8 9
Hexadecimal 0
Hexadec
imal
System
Decimal 0 1 2 3 4 5 6 7 8 9
Hexadecimal 0 1
Hexadec
imal
System
Decimal 0 1 2 3 4 5 6 7 8 9
Hexadecimal 0 1 2
Hexadec
imal
System
Decimal 0 1 2 3 4 5 6 7 8 9
Hexadecimal 0 1 2 3 4 5 6 7 8 9
Hexadec
imal
System
Decimal 0 1 2 3 4 5 6 7 8 9 10
exadecimal 0 1 2 3 4 5 6 7 8 9 A
Hexadec
imal
System
ecimal 0 1 2 3 4 5 6 7 8 9 10 11
ecimal 0 1 2 3 4 5 6 7 8 9 A B
Hexadec
imal
System
3 4 5 6 7 8 9 10 11 12 13 14 15
3 4 5 6 7 8 9 A B C D E F
Hexadec
imal
System
5 6 7 8 9 10 11 12 13 14 15 16
5 6 7 8 9 A B C D E F 10
Integers
5 5 1 9 3 2
10
Integers
5 5 1 9 3 2
10
105 104 103 102 101 100
5 5 1 9 3 2
10
105 104 103 102 101 100
5 5 1 9 3 2
10
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
9 x 102 = 900
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
9 x 102 = 900
1 x 103 = 1000
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
9 x 102 = 900
1 x 103 = 1000
5 x 104 = 50000
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
9 x 102 = 900
1 x 103 = 1000
5 x 104 = 50000
5 x 105 = 500000
105 104 103 102 101 100
5 5 1 9 3 2
10
2 x 100 = 2
3 x 101 = 30
9 x 102 = 900
1 x 103 = 1000
5 x 104 = 50000
5 x 105 = 500000
551932
Binary-to
-decimal
1 0 0 1 0 1
2
Binary-to
-decimal
25 24 23 22 21 20
1 0 0 1 0 1
2
25 24 23 22 21 20
1 0 0 1 0 1
2
25 24 23 22 21 20
1 0 0 1 0 1
2
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
1 x 22 = 4
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
1 x 22 = 4
0 x 23 = 0
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
1 x 22 = 4
0 x 23 = 0
0 x 24 = 0
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
1 x 22 = 4
0 x 23 = 0
0 x 24 = 0
1 x 25 = 32
25 24 23 22 21 20
1 0 0 1 0 1
2
1 x 20 = 1
0 x 21 = 0
1 x 22 = 4
0 x 23 = 0
0 x 24 = 0
1 x 25 = 32
37
Base-to-
decimal
N
X 1
i
General rule mi b
i=0
b 5 b 4 b 3 b 2 b 1 b 0
m5 m4 m3 m2 m1 m0
b
Data
Types
y p es are N OT o bj e c t s
Primitive t
Primitive
Value Exa
m ples
Primitive
Value Exa
m ples
Integer
Primitive
Value Exa
m ples
Integer
0 -5 360 12000
Primitive
Value Exa
m ples
Integer
Floating-point
Primitive
Value Exa
m ples
Integer
Floating-point
0.15 -33.3 3.14159
Primitive
Value Exa
m ples
Integer
Floating-point
Character
Primitive
Value Exa
m ples
Integer
Floating-point
Character
‘a‘ ‘A‘ ‘#‘ ‘ ‘ ‘\n‘
Primitive
Value Exa
m ples
Integer
Floating-point
Character
Boolean
Primitive
Value Exa
m ples
Integer
Floating-point
Character
Boolean
true false
Variables
Variables
type variableName
Variable
Declaratio
n
type variableName
int, char, double,
etc.
Variable
Declaratio
n
type variableName
l e g a l i d ent if i e r
must be
Variable
Declaratio
n
type variableName
char initial; /* 16 bits allocated */
int count; /* 32 bits allocated */
double time; /* 64 bits allocated */
type
char initial; /* 16 bits allocated */
int count; /* 32 bits allocated */
double time; /* 64 bits allocated */
char initial; /* 16 bits allocated */
int count; /* 32 bits allocated */
variable n ame
double time; /* 64 bits allocated */
char initial; /* 16 bits allocated */
int count; /* 32 bits allocated */
double time; /* 64 bits allocated */
byte number;
memory
memory address
byte number;
memory
memory address
byte number;
memory
number
O T compare values
Does N
=
assigns variable on left the value
on right side
N O T compare values
D o e s
Assignme
nt
initial = 'a';
count = 5;
rate = factor;
time = time + 1;
Assignme
nt
initial = 'a';
count = 5;
rate = factor;
time = time + 1;
Assignme
nt
initial = 'a';
count = 5;
rate = factor;
time = time + 1;
Assignme
nt
initial = 'a';
count = 5;
rate = factor;
time = time + 1;
Assignme
nt
initial = 'a';
count = 5;
rate = factor;
time = time + 1;
Assignme
nt
initial = 'a';
count = 5;
rate = factor;
time = time + 1;
byte number;
number = 7;
memory
memory address
byte number;
number = 7;
memory
memory address
byte number;
number = 7;
memory
number
number = 7;
memory
number
number = 7;
memory
number
number = 7;
memory
0 0 0 0 0 1 1 1
number
memory address 197508
char initial;
initial = 'a';
memory
memory address
char initial;
initial = 'a';
memory
memory address
char initial;
initial = 'a';
memory
initial
memory address
char initial;
initial = 'a';
memory
initial
memory address
Unicode
Table
char initial;
initial = 'a';
memory
initial
memory address
char initial;
initial = 'a';
memory
0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1
initial
memory address
Multiple
Declaratio
ns
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
What is th e o u t p u t ?
public class SimpleAssignment
{
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
outputSystem.out.println(num1);
argument with no carr
System.out.print("num2 = i");
age return
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
What is th e o u t p u t ?
public class SimpleAssignment
{
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
What is th e o u t p u t ?
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
Console
}
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
Console
}
java SimpleAssignment
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
Console
}
java SimpleAssignment
num1 = 5
num2 = 1
num3 = 1
public class SimpleAssignment
{
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment
{
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = undefined
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = undefined
public static void main(String[] args)
num3 = undefined
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = undefined
public static void main(String[] args)
num3 = undefined
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = 1
public static void main(String[] args)
num3 = undefined
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = 1
public static void main(String[] args)
num3 = undefined
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 1
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment num1 = 5
{ num2 = 1
public static void main(String[] args)
num3 = 1
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
public class SimpleAssignment
{
public static void main(String[] args)
{
int num1 = 1, num2, num3;
num2 = num1;
num3 = num2;
num1 = 5;
System.out.print("num1 = ");
System.out.println(num1);
System.out.print("num2 = ");
System.out.println(num2);
System.out.print("num3 = ");
System.out.println(num3);
}
}
Identifiers
identifier
names used for variables, methods and
classes
Identifier
Rules
Identifier
Rules
Must not be a reserved word
Identifier
Rules
Must not be a reserved word
abstract default if package synchronized
assert do implements private this
boolean double import protected throw
break else instanceof public throws
byte extends int return transient
case false interface short true
catch final long static try
char finally native strictfp void
class float new super volatile
const for null switch while
continue goto
HelloWor
ld.java
CASE SENSITIVE
Abc _32 32X Price$ file?1
i t h var i a b l e n a m es ?
Issue w
Java Nam
ing
Conventio
n
class: HelloWorld
method: outputLine()
variable: listHead
Arithmetic expressions
Unary
Operators
Unary
Operators
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
+x = 3
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
+x = 3
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
+x = 3
-x = -3
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
+x = 3
-x = -3
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
+x = 3
-x = -3
x = 3
int x = 3;
System.out.print("+x = ");
System.out.println(+x);
System.out.print("-x = ");
System.out.println(-x);
System.out.print("x = ");
System.out.println(x);
Output
+x = 3
-x = -3
x = 3
Binary
Operators
Binary
Operators
Addition (+)
3 + 4 or 55.1 + 43.58
Binary
Operators
Addition (+)
3 + 4 or 55.1 + 43.58
Subtraction (-)
50 - 20 or 45.3 - 0.78
Binary
Operators
Addition (+)
3 + 4 or 55.1 + 43.58
Subtraction (-)
50 - 20 or 45.3 - 0.78
Multiplication (*)
5 * 10 or 0.6 * 3.4
Addition (+)
3 + 4 or 55.1 + 43.58
Subtraction (-)
50 - 20 or 45.3 - 0.78
Multiplication (*)
5 * 10 or 0.6 * 3.4
Division (/)
50.0 / 2.0 or 45 / 2
Addition (+)
3 + 4 or 55.1 + 43.58
Subtraction (-)
50 - 20 or 45.3 - 0.78
Multiplication (*)
5 * 10 or 0.6 * 3.4
Division (/)
50.0 / 2.0 or 45 / 2
Remainder (%)
30 % 7 or 45 % 3 or 23 % 77
Arithmetic expression with integers and
floating-points is a floating-point
Arithmetic expression with integers and
floating-points is a floating-point
d a m i xe d ex pres s i o n
Calle
Mixed
Expressi
ons
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
37.0
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
37.0
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
37.0
37
Mixed
Expressi
ons
System.out.println(30.0 + 7);
System.out.println(30 + 7);
Output
37.0
37
Integer
Division
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
1.75
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
1.75
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
1.75
1.75
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
1.75
1.75
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
1.75
1.75
1
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
result truncated
Output
1.75
1.75
1
System.out.println(7.0 / 4.0);
System.out.println(7.0 / 4);
System.out.println(7 / 4);
Output
1.75
1.75
1
Can you spot the ERRO
R ?
int midTerm1 = 63;
int midTerm2 = 84;
int finalExam = 83;
double average =
( (double)(midTerm1 + midTerm2 + finalExam) )/3;
double average =
( (double)(midTerm1 + midTerm2 + finalExam) )/3;
t y p ecast
System.out.println("Average mark: " + average);
Can you spot the ERRO
R?
double balance = 33.3;
int dollars = balance;
double balance = 33.3;
int dollars = balance;
compiler disallows floa
t ing-point to integer as
signment
double balance = 33.3;
int dollars = (int) balance;
typecast
How do we evaluate
compound expressions?
(a + b) / c + a / c - a + b / c * b
Order of
Operatio
ns
Order of
Operatio
ns
z - (a + b / 2) + w * -y
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
3. Multiplication
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
3. Multiplication
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
3. Multiplication
4. Subtraction
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
3. Multiplication
4. Subtraction
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
3. Multiplication
4. Subtraction
5. Combine
Evaluate the following expression:
z - (a + b / 2) + w * -y
1. Parentheses
b/2 then add a
2. Unary
3. Multiplication
4. Subtraction
5. Combine