Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Order {
- public String orderId;
- public double price;
- public Order(String orderId, double price) {
- this.orderId = orderId;
- this.price = price;
- }
- public void displayInfo() {
- System.out.println("The order id is: " + orderId + "\nThe price of the order is: " + price);
- }
- public double applyDiscount(double discountPercentage) {
- return price - (discountPercentage / price * 100);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement