Advertisement

Create a class called Restaurant that includes three pieces of information

Create a class called Restaurant that includes three pieces of information Create a class called Restaurant that includes three pieces of information: name, address, and gratuity rate. Provide properties with get and set assessors for all instances variables, and do not allow negative values for gratuity rate. Define a constructor that uses name, address, and gratuity rate as a parameter, and initialize three values.
Your class must also include a method to generate a sales receipt. Using a WHILE loop. The method will collect the price for each food item ordered, and it will keep a subtotal for an arbitrary number of food item. Once the subtotal of all food has been calculated, the method will then determine the amount for gratuity if the party consisted of 6 more people. The grand total will be the subtotal plus gratuity. The method must also display the amount for subtotal, gratuity, and grand total.
Create a Restaurant object, and generate a sales receipt. Use (15%=0.15) as gratuity rate.

Create a class called Restaurant that includes three pieces of information: name,address,and gratuity rate.,

Post a Comment

0 Comments