-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFood.java
50 lines (40 loc) · 1.18 KB
/
Food.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public class Food {
int restaurantId;
String catagory;
String name;
double price;
public Food(int id, String category, String name, double price) {
this.restaurantId = id;
this.catagory = category;
this.price = price;
this.name = name;
}
public void setFoodname(String name) {
this.name = name;
}
public void setCategory(String name) {
this.catagory = name;
}
public void setprice(double n) {
this.price = n;
}
public int getresid() {
return this.restaurantId;
}
public String getfoodname() {
return this.name;
}
public String getCategory() {
return this.catagory;
}
public double getPrice() {
return this.price;
}
public void Displayfood() { // category name price
System.out.println("Category: " + catagory + ", Food Name: " + name + ", Price: " + price);
}
public void DisplayFoodWithId() {
System.out.println("Restaurant id: " + this.restaurantId + ", Category: " + catagory + ", Food Name: " + name
+ " Price: " + price);
}
}