Skip to content

Commit 76cbaa4

Browse files
committed
Studio Pt. 1 Updated
1 parent 301193a commit 76cbaa4

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.launchcode;
2+
3+
public class Main {
4+
5+
public static void main(String[] args) {
6+
7+
MenuItem item1 = new MenuItem ("Brown Sugar Salmon", "Who doesn't like a little sugar on their salmon?", 34.99, "main course" );
8+
MenuItem item2 = new MenuItem ("Cajun Lobster Mac n' Cheese", "Combining three of your favorites into one dish.", 22.99, "appetizers" );
9+
MenuItem item3 = new MenuItem ("Garlic Breadsticks", "Something light, something cheesy.", 18.99, "appetizers" );
10+
MenuItem item4 = new MenuItem ("8oz Sirloin", "For the men.. or women.", 34.99, "main course" );
11+
MenuItem item5 = new MenuItem ("Unlimited Ice Cream", "Choose 1 or choose all your favorite flavors.", 29.99, "dessert" );
12+
13+
System.out.println(item1);
14+
15+
}
16+
17+
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
public class Menu {
66

7-
private arrayList<MenuItem> menuItems = new arrayList<>();
7+
private ArrayList<MenuItem> menuItems = new ArrayList<>();
88
private LocalDate lastUpdated;
99

1010
// Allow for default constructor
11-
public arrayList<MenuItem> getMenuItems() {
11+
public ArrayList<MenuItem> getMenuItems() {
1212
return menuItems;
1313
}
14-
}
14+
15+
}

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.launchcode;
22

3+
import java.time.LocalDate;
4+
import java.time.temporal.ChronoUnit;
5+
36
public class MenuItem {
47

58
private String name;
@@ -20,19 +23,37 @@ public String getName() {
2023
return name;
2124
}
2225

26+
public void setName(String name) {
27+
this.name = name;
28+
}
29+
2330
public String getDescription() {
2431
return description;
2532
}
2633

34+
public void setDescription(String description) {
35+
this.description = description;
36+
}
37+
2738
public double getPrice() {
2839
return price;
2940
}
3041

42+
public void setPrice(double price) {
43+
this.price = price;
44+
}
45+
3146
public String getCategory() {
3247
return category;
3348
}
3449

50+
public void setCategory(String category) {
51+
this.category = category;
52+
}
53+
3554
public LocalDate getDateAdded() {
3655
return dateAdded;
3756
}
57+
58+
3859
}

0 commit comments

Comments
 (0)