Question: Create a new class Order with the instance variables and methods mentioned below. Method Description calculateTotalPrice(int unitPrice) Calculate the total price by applying a service
Create a new class Order with the instance variables and methods mentioned below. Method Description calculateTotalPrice(int unitPrice) Calculate the total price by applying a service charge of 5% on the food item ordered and store it in the instance variable totalPrice. Return the calculated total price. Create an object of the Order class, initialize the instance variables, invoke the calculateTotalPrice() method and display the values of the instance variables in the main() method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
