Menu

Restaurant Restaurant Sell Following Hamburger 3 Hot Dog 2 Milk Shake 3 Start Writing Func Q43864029

You own a restaurant. In your restaurant, you sell thefollowing:

     Hamburger $3each

    Hot Dog $2 each

    Milk Shake $3 each

Start by writing a function with a name like‘calculateBill’ that will do the following:

– Allow the caller to pass in threeparameters:

the number of hamburgers to buy

the number of hot dogs to buy

the number of milk shakes to buy

– Calculate the subtotal of this purchase, by doing somesimple math.

– Add 10% of that amount for tax, to get atotal

– it should return the total amount for thepurchase

– The calculateBill function should NOT print anything,only the main code should do the printing.

Then write 3 calls to the function:

-The first two calls should use different amounts ofhamburgers, hot dogs, and milk shakes.

-To verify that your function works correctly, test withthese values:

   3 hamburgers, 2 hot dogs, and 1 milkshake.

This order should come out to (16.00 plus 1.60 tax)17.60.

   8 hamburgers, 8 hot dogs, and 8milkshakes

This order should give a cost 70.40.

To prepare for the third call, you need to add someinteractivity. Ask the user three questions to get the number ofhamburgers, hot dogs, and milk shakes they want to order (reminder:to get input from the user, use the input built-in function). Thenthe third call to the calculateBill function should use the numbersyou got from the user.

After each call to the function, add a line to print outthe resulting bill, for example:

   Your bill is: $123.45

Do NOT worry about the number of decimal places shown.For example, in the first example above with 3 hamburgers, 2 hotdogs, and 1 milkshake, the total will probably print as 17.6 – thatis OK.

Expert Answer


Answer to You own a restaurant. In your restaurant, you sell the following: Hamburger $3 each Hot Dog $2 each Milk Shake $3 each S…

OR