Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package AI164.Tunon;
- public class Item{
- private String name;
- private double price;
- public Item(String name, double price) {
- this.name = name;
- this.price = price;
- }
- public String getName (){
- return this.name;
- }
- public double getPrice(){
- return this.price;
- }
- public double changePrice(double percent){
- if (percent <= 0)
- return 0;
- else
- return this.price * percent;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement