⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coffeebrewer.java

📁 ssd2 exercise3 的题目和答案
💻 JAVA
字号:
/**
 * This class maintains the attributes and methods of the CoffeeBrewer.
 *
 * @author Luorenhu
 * @version  1.0.0
 */
public class CoffeeBrewer extends Product
{
	
	/* model */
    private String model;
    
    /* water supply */
    private String waterSupply;
    
    /* number of cups */
    private int numberOfCups;
    
    
    /**
	 * Constructs an <code>Coffee</code> object.
	 *
	 * @param initialCode  a string with the code of the coffee brewer.
	 * @param initialDescription  a string that describes the coffee brewer.
	 * @param initialPrice  a double that represents the price of the coffee brewer.
	 * @param initialModel  a string with the model of the coffee brewer.
	 * @param initialWaterSupply  a string with the water supply of the coffee brewer.
	 * @param initialNumberOfCups  a integer with the numbers of the cups of the coffee brewer.
	 */
    public CoffeeBrewer(String initialCode, String initialDescription, double initialPrice, 
    String initialModel, String initialWaterSupply, int initialNumberOfCups)
    {
        super(initialCode, initialDescription, initialPrice);
        model = initialModel;
        waterSupply = initialWaterSupply;
        numberOfCups = initialNumberOfCups;
    }
	
	 /**
	 * Returns the model of the coffee brewer.
	 *
	 * @return  model of the coffee brewer.
	 */
    public String getModel()
    {
        return model;
    }
	
	/**
	 * Returns the water supply of the coffee brewer.
	 *
	 * @return  water supply of the coffee brewer.
	 */
    public String getWaterSupply()
    {
        return waterSupply;
    }
	
	/**
	 * Returns the number of cups of the coffee brewer.
	 *
	 * @return  number of cups of the coffee brewer.
	 */
    public int getNumberOfCups()
    {
        return numberOfCups;
    }
	
	/**
	 * Returns the string representation of this <code>CoffeeBrewer</code>
	 * object (overrides the {@link Object#toString()} method).
	 *
	 * @return  the string representation of this <code>CoffeeBrewer</code>
	 *          object.
	 */
    public String toString()
    {
        String message = super.toString() + "_"+getModel() + "_"+getWaterSupply() + "_" + getNumberOfCups();
        return message;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -