Question: In Java: Write a complete Java class named Dinner that has the following private attributes: Write a complete Java class named Dinner that has the
In Java:

Write a complete Java class named Dinner that has the following private attributes: Write a complete Java class named Dinner that has the following private attributes: a. An array of String named dishNames. b. An array of double named dishPrices c. An int named numDishes d. A double named taxRate. And the following methods a. public DinnerCO - Creates the arrays (with a size of 10) and initializes the numDishes to zero and the to taxRate 8.875% b. Getters for all the attributes c. public void addDish(String name, double price). This method adds a dish with the d. public double computeTax). This method computes the amount of tax due for the e. public double computeTotalO.This method computes the total amount due for the f. public boolean equalsCObject obj). Two Dinner objects are equal if their numDishes g. public String toString.This method returns an itemized String representing the given name and price to the arrays and maintains the count of dishes in numDishes purchased dishes included in the arrays purchased items included in the arrays, plus the tax that is due. are equal, their taxRate are equal and all their dishNames and dishPrices are all equal receipt of all the dishes purchased, the tax due and the total due
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
