previous |
start |
next
Implementing the getTotal Method
public class Purse
{
public double getTotal()
{
return nickels * 0.05
+ dimes * 0.1 + quarters * 0.25;
}
private int nickels;
private int dimes;
private int quarters;
}
* = multiplication
previous |
start |
next