Customer - numberGenerator += 2; } public boolean...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.text.DecimalFormat; public class Customer { private String name; // default is null private boolean nofly; // default is false private int age; // default is 0 private long ffn; // frequent flyer number, default is 0 private int points; private static int numberGenerator = 100; // ti assign ffns private static int delta = 2; // to get next number public Customer(String name, int age){ this.name = name; if (age < 0) System.out.println("ERROR: age is " + age); else this.age = age; ffn = numberGenerator;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: numberGenerator += 2; } public boolean okToFly(){ return !nofly; } public String toString(){ DecimalFormat f = new DecimalFormat("0000000000"); return ("[" + f.format(ffn) + "] " + name); } public void blackList() { nofly = true; } public void birthday() { age++; } public long getFFN() { return ffn; } public void makeReservation(int p){ points += p; } public int getPoints() { return points; } public static void setDelta(int d) { if (d > 0) delta = d; } }...
View Full Document

This note was uploaded on 04/03/2010 for the course COMPSCI 600.107 taught by Professor Houlahan during the Spring '08 term at Johns Hopkins.

Page1 / 2

Customer - numberGenerator += 2; } public boolean...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online