Week 0
Goals:
- set up tools
Tangibles:
- Freeform drawing:
Week 1
Goals:
- download tools
- get github pages working
- Get local hosting ready
Tangibles: My blog
Week 2
Goals:
- Get java working
- Learn about java
Terms:
- OOP-Object Oriented Programming, Java is built for this
- Class-a blueprint for code
Tangibles:
- See below
System.out.println("hello world")
Below is code that is “bad”-it does not use OOP
int sum = 0;
for (int i=1; i<101; i++) {
sum = sum+i;
}
System.out.println(sum)
5050
Below is the above code rewritten to use OOP.
public class SumObject {
private int sum;
public SumObject() {
sum = 0;
}
public int getSum() {
return sum;
}
public void setSum(int s) {
sum = s;
}
public static void main(String[] args) {
SumObject summer = new SumObject();
for (int i=1; i<101; i++) {
int s = summer.getSum();
summer.setSum(i+s);
}
System.out.println(summer.getSum());
}
}
SumObject.main(null);
4950