Question: in java This week I want you to write a program that contains two classes. The first is your normal Main class. This class will
in java
This week I want you to write a program that contains two classes. The first is your normal Main class. This class will act as a client class and only be used to test your custom class. The second is your custom class, which we will call Restaurant. The Restaurant class will have the following private fields: Dooky Chase's Restaurant Since 19.11 1. name: String 2. address: String 3. genre: String 4. numOfRatings: int 5. rating: double You will need to implement public getters and setters (accessors and mutators) for the first three fields: name, address, and genre. In addition you will need to implement the following public methods. 1. rate(score: int): void 2. getRating(): double 3. display(): void The rate(int) method should take a rating between 1 and 10 and alter the rating field of that instance by an appropriate amount given the current rating and number of ratings. It should also increment the numOfRatings by one to reflect the new rating. The getRating() method should just return the value of the rating field. (Basic getter.) I only listed it separately so that you would know I don't want you to create a setter for that field. You set the rating of a Restaurant by rating the Restaurant. The display() method is just a convenience method to print all of the information about an instance of Restaurant to the screen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
