Question: Implement the class Tip according to the given UML and use it as the background class. TipCalculator private Tip tip; //an instance of Tip private
Implement the class Tip according to the given UML and use it as the background class.
| TipCalculator |
| private Tip tip; //an instance of Tip private String[] strLabel={}; //initilize the array private TextField[] txt; private String[] strBtn = {}; //initialize the array private Button[] btn;
|
| Tip |
| private double amount; //amount of dollar consumed private static double taxRate; //percent of tax private double tipPercent ; //percent of tip |
| public Tip(); public Tip(double amount, double tipPercent); public double getAmount(); public void setAmount(double amount); public double getTipPercent(); public void setTipPercent(double tipPercent); public static double getTaxRate(); public static void setTaxRate(double taxRate); public double calculateTax() public double calculateTip() public double calculateTotal()
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
