Question: In Lab 3, you wrote a program for a restaurant, which had no methods. Create a program similar to that one (you can even pull
In Lab 3, you wrote a program for a restaurant, which had no methods. Create a program similar to that one (you can even pull up your old code to edit if you wish), but with methods to calculate the billing. The following methods are required: calculateDiscount() //This will calculate what discount percent the user gets. calculateFinalPrice() //This will calculate the final price after the discount and adds tax to it. You must determine the parameters and return value type for each method yourself. You may also add your own methods if you believe it will be useful.
Reference for lab 3:
A new restaurant near university is celebrating its 3rd year of opening. For this occasion, they are giving awayspecial offers to customers. The manager wants you to write a program for customers that will do the following things:1.Draw a flowchartin yournotebookto show the logic flow of thisprogram. You may read through the rest of the steps to get a better idea, but make sure you create the flowchart before coding.2.Write your comments! You should always write comments, even if it doesnt say so in the steps/instructions. 3.Have a welcome messageto the customer that describes this special event as well as the possible discounts: a 50/50 chance to either get a 20% discount, or a 25% discount.4.Simulate a coin toss to determine which discount the customer will get. How can you do this using random numbers?5.Display which discount the customer has received along with a nice message. How will you display a specific message depending on the coin tosss result?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
