// This file contains excerpts from the textbook Concrete // Abstractions: An Introduction to Computer Science Using Scheme, by // Max Hailperin, Barbara Kaiser, and Karl Knight, Copyright (c) 1998 // by the authors. Full text is available for free at // http://www.gustavus.edu/+max/concrete-abstractions.html public class OxfordShirt extends Item { private String color; private int neck; private int sleeve; private boolean specifiedYet; public OxfordShirt(){ super(1950); // allow Item class to initialize with price specifiedYet = false; } public void display(){ if(specifiedYet){ System.out.print(color); System.out.print(" Oxford shirt, size "); System.out.print(neck); System.out.print("/"); System.out.print(sleeve); System.out.print("; "); } else { System.out.print("Oxford shirt; "); } super.display(); // now do displaying the Item way } public void inputSpecifics(){ System.out.println("What color?"); String[] colors = {"Ecru", "Pink", "Blue", "Maize", "White"}; color = CompuDuds.inputSelection(colors); System.out.print("What neck size? "); neck = CompuDuds.inputIntegerInRange(15, 18); System.out.print("What sleeve length? "); sleeve = CompuDuds.inputIntegerInRange(32, 37); specifiedYet = true; } }