public class CalculatorModel extends Object
Constructor and Description |
---|
CalculatorModel(double amount,
int percentage,
int number)
Initializes this model with the given amount of the bill, the percentage of tip and the number of people among which to split the total amount.
|
Modifier and Type | Method and Description |
---|---|
double |
getPerPerson()
Returns the amount that each person has to pay.
|
double |
getTotal()
Returns the total amount that has to be paid.
|
public CalculatorModel(double amount, int percentage, int number)
amount
- the amount of the bill.percentage
- the percentage of the bill used for tip.number
- the number of people among which to split the total amount.