// LANDSCAPE GARDENING QUOTE ITEM // Frans Coenen // University of Liverpool // 18 April 2013 import java.util.*; public class QuoteItem { // ------------------- FIELDS ------------------------ /** Instance of Scanner class. */ protected static Scanner input = new Scanner(System.in); /** Name of quote item (e.g. "lawn", "patio", "water feature", etc.). */ protected String itemName = null; /** The unit material cost for this landscape gardening item. */ protected double unitMaterialCost = 0.0; /** The unit installation time for this landscape gardening item. */ protected double unitInstallationTime = 0.0; /** The total material cost for this landscape gardening item. */ protected double totalMaterialCost = 0.0; /** The total installation time for this landscape gardening item. */ protected double totalInstallationTime = 0.0; // ---------------- CONSTRUCTORS --------------------- /** Default constructor. */ public QuoteItem() { } /** Three argument constructor. @param nm the name for this landscape gardening item. @param ct the unit material cost for this landscape gardening item. @param tm the total labour time to install this landscape gardening item. */ public QuoteItem(String nm, double ct, double tm) { itemName = nm; unitMaterialCost = ct; unitInstallationTime = tm; } // ---------------- GET METHODS --------------------- /** Get method to return the rtotal material cost for this landscape item. @return Material cost. */ protected double getTotalMaterialCost() { return(totalMaterialCost); } /** Get method to return the total installation time for this landscape item. @return Installation time. */ protected double getTotalInstallationTime() { return(totalInstallationTime); } // ---------------- OUTPUT METHODS --------------------- /** To string method. */ public String toString() { String s = itemName + ": Unit material cost = £" + unitMaterialCost + ", Unit installation time = " + unitInstallationTime + " (minutes)\n"; return(s); } }