Skip to content

Commit 5bd6dbe

Browse files
committed
Studio Pt. 1
1 parent b7e3186 commit 5bd6dbe

3 files changed

Lines changed: 52 additions & 8 deletions

File tree

classes-part-one/studio/restaurant-menu/src/main/java/org/launchcode/Main.java

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.launchcode;
2+
import java.time.LocalDate;
3+
import java.util.ArrayList;
4+
5+
public class Menu {
6+
7+
private arrayList<MenuItem> menuItems = new arrayList<>();
8+
private LocalDate lastUpdated;
9+
10+
// Allow for default constructor
11+
public arrayList<MenuItem> getMenuItems() {
12+
return menuItems;
13+
}
14+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.launchcode;
2+
3+
public class MenuItem {
4+
5+
private String name;
6+
private String description;
7+
private double price;
8+
private String category;
9+
private final LocalDate dateAdded;
10+
11+
public MenuItem(String name, String description, double price, String category) {
12+
this.name = name;
13+
this.description = description;
14+
this.price = price;
15+
this.category = category;
16+
this.dateAdded = LocalDate.now();
17+
}
18+
19+
public String getName() {
20+
return name;
21+
}
22+
23+
public String getDescription() {
24+
return description;
25+
}
26+
27+
public double getPrice() {
28+
return price;
29+
}
30+
31+
public String getCategory() {
32+
return category;
33+
}
34+
35+
public LocalDate getDateAdded() {
36+
return dateAdded;
37+
}
38+
}

0 commit comments

Comments
 (0)