Most of you have silo accounts. 

Some don't. 

Tomorrow they will be created. 

Welcome to DrJava.  Working directory is C:\Users\dgerman
> import java.math.BigDecimal
> BigDecimal a = new BigDecimal("0.1")
> a.add(a)
0.2
> a.add(a).add(a)
0.3
> (a.add(a)).add(a)
0.3
> BigDecimal b = a.add(new BigDecimal("0.1"))
> b
0.2
> 0.1 + 0.1
0.2
> 0.1 + 0.1 + 0.1
0.30000000000000004
> a.add(b)
0.3


Familiarize yourself with this notation. 

Start reading the book. 

1. Introduction

1.7 Design Recipe 

(a) choose a data representation

(b) give examples

(c) name, signature 

(d) purpose statement 

(e) function template

(f) write code

(g) test it 

Read chapter 2. Using Objects 

Welcome to DrJava.  Working directory is C:\Users\dgerman
> import java.math.BigDecimal
> BigDecimal a = new BigDecimal(4.53)
> BigDecimal b = new BigDecimal(4.35)
> b
4.3499999999999996447286321199499070644378662109375
> a
4.53000000000000024868995751603506505489349365234375
> BigDecimal c = new BigDecimal(2)
> c
2
> BigDecimal d = new BigDecimal(0.1)
> d
0.1000000000000000055511151231257827021181583404541015625
> BigDecimal e = new BigDecimal("0.1")
> d
0.1000000000000000055511151231257827021181583404541015625
> e
0.1


Start with the lab notes:

class One {
  public static void main(String[] args) {
     System.out.print("2 + 3");
     System.out.print(" = "); 
     System.out.println(2 + 3);     
  }
}

This produces:

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
2 + 3 = 5


There are four classes of primitive types in Java:

(a) whole numbers           int byte long short

(b) numbers with decimals   double float 

(c) characters              char 

(d) booleans                boolean 

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> "tomato"
"tomato"
> "automaton"
"automaton"
> "automaton".substring(2, 8)
"tomato"
> "nothing".substring(2)
"thing"
> "nothing".substring(2, 3)
"t"
> "nothing".charAt(2)
't'
> "t".length()
1
> "".length()
0
> "a" + "t"
"at"
> 'a' + 't'
213


Now let's print strings:

class One {
  public static void main(String[] args) {
     System.out.print("+----+\n|    |\n+----+\n");
  }
}

Compile and run:

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
+----+
|    |
+----+


Write a program that prints this owl:


              ___
             ('v')
            ((   ))
          -/-"---"--