« All Events
12 PM – Intro To Java – Gamas
January 15, 2022 @ 12:00 pm - 1:00 pm
Today We Do
- We created Restaurant class with 3 attributes: name, type and capacity.
- We continued with RestaurantSystem, added 2 features: add new restaurant and list all restaurants.
Homework
- Create getter and setter of Restaurant.name and Restaurant.capacity.
- For setCapacity method, check inside the method if the capacity is less than 1, then don’t set the capacity, but print “Invalid capacity, it has to be 1 or more”.
- In listAllRestaurant method, print restaurant info like the following “<restaurant name> – <type> – <capacity> people.” . For example, “Kang Ho Dong – Korean BBQ – 50 people”