-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrder.java
More file actions
22 lines (21 loc) · 662 Bytes
/
Copy pathOrder.java
File metadata and controls
22 lines (21 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package java_core;
public class Order {
int orderId;
String orderedFood;
double totalPrice;
String status;
double calculateTotalPrice(int unitPrice){
totalPrice=unitPrice+unitPrice*0.05;
System.out.println("Order Details\nOrder ID: "+orderId+"\n"+"Ordered food: "+orderedFood+"\n"+"Order Status: "+status+"Total Price: "+totalPrice);
return totalPrice;
}
}
class Tester1{
public static void main(String args[]){
Order order1 = new Order();
order1.orderId= 1001;
order1.orderedFood= "pineapple pizza";
order1.status = "delivered";
order1.calculateTotalPrice(65);
}
}