✓ Kizspy.me -
Question 1: (2 marks)
Do not pay attention to the real meaning of objects, variables, and their values in the questions below.
Write a class Restaurant (in the default package of the NetBeans) with the following information:
Restaurant
-restaurantName: String
-city: String
-seatedGuests: int
- guestCapacity: int
+ Restaurant(restaurantName: String,
city: String, seatedGuests: int,
guestCapacity: int)
+ getRestaurantName(): String
+ getAvailableSeating(): int
+toString(): String
Where:
Restaurant (restaurantName: String, city: String,
seatedGuests: int, guestCapacity: int)-
parameterized constructor, which sets values to
restaurantName, city, seatedGuests, and
guestCapacity.

getRestaurantName(): String If the restaurant
name is longer than 10 characters, only return the
first 10 characters of the name in uppercase. If it's
10 characters or fewer, return the entire name in
uppercase. (Hints: use the substring method)

getAvailableSeating(): int returns the available
seating with the available seating guestCapacity -
seated Guests. If the available seating <0 then
returns 0.
. Override toString():String return a string that
contains all the information of the restaurant:
restaurantName-city-seated Guests-guestCapacity
Zoom
+100%
Close