Howdy. 

public class Something {
  public static int add(int a, int b) {
    return a + b; 
  }
  public static int max(int a, int b) {
    return (Something.add(a, b) + Math.abs(a - b)) / 2;
  }
  public int fun() {
    return 1; 
  }
/* 
  Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
  > Something.fun()
  Static Error: No method in static Something has name 'fun'
  > a = new Something()
  Static Error: Undefined name 'a'
  > Something a = new Something()
  > BigDecimal b = new BigDecimal("0.1")
  Static Error: Undefined class 'BigDecimal'
  > import java.math.BigDecimal; // auto-import
  BigDecimal b = new BigDecimal("0.1")
  > b
  0.1
  > a
  Something@266ca13a
  > a.fun()
  1
  > Something c = new Something()
  > c.fun()  
  1
  > */ 
}

Define a static method that calculates the square root of a number. 

public class Something {
  public static int sum(int limit) {
    if (limit == 0) return 0; 
    else return limit + Something.sum(limit - 1); 
  }
  public static void main(String[] args) {
    int n = 10; 
    System.out.println( Something.sum( n ) ); // prints 55
  }
}

Now I need something better. 

import java.util.Scanner; 

public class Something {
  public static int sum(int limit) {
    if (limit == 0) return 0; 
    else return limit + Something.sum(limit - 1); 
  }
  public static void main(String[] args) {
    Scanner read; 
    read = new Scanner( System.in ); 
    System.out.print("Name: "); 
    String name; 
    name = read.nextLine(); // entire line the user has typed 
    // System.out.println("How are you, " + name + "?"); 
    System.out.print("How old are you, " + name + ": "); 
    int age = read.nextInt(); 
    System.out.println(name + ", you will be " + (age + 1) + " next year."); 
    // "12" + 3 --> "123" 
  }
  /* 
   
   Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
   > run Something
   Name:  [DrJava Input Box]
   How old are you, Chun:  [DrJava Input Box]
   Chun, you will be 2 next year. 
   > 
    
   */ 
}

Purpose statement and sketch the square root function. 

Lab 02 has been posted.

Homework 01: write function that calculates greatest common divisor of a and b.

  input: 6

  0--------------------------------------6

  0--------------------3

           1.5---------3

Thu 05/09 correction thanks to Mr. T: 

  Homework 01 is the square root

  Homework 02 is now the GCD