Assignment 3
Designing Methods
Text as pdf or
html
The program for Problem 3.2:
Banking.java
The program that illustrates the design of the world:
BlobWorldFun.java
Due Date: Tuesday February 2nd, 10:00 pm.
Homework submissions instructions:
- Every file you submit must have the header with the names of
both partners. See the main Assignments web page for
details. We will give no grade to submissions that are
missing the header.
- The names of the files you submit for each problem must be the
following:
- Problem 3.1: City.java
- Problem 3.2: Banking.java
- Problem 3.3: GameWorld.java
- The progams you submit must run in FunJava. We will deduct
points if the program does not run or will give no
grade to programs that do not run.
Designing tests for inexact numbers
Please, read the following page for explanation of the design of tests for inexact values:
Comparing Inexact Values
then consult the tester web page for concrete examples:
Inexact Values Tests
To generate random numbers,
import java.util.Random;
then define field:
Random RAND = new Random();
then define a method:
// produce a random number in the range [0, 5)
int randomNum(){
return this.RAND.nextInt() % 5;
}
and use it when you need such number. Adjust this to fit your
game design.