Ask Question
3 April, 19:30

Write a program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the restaurant charge, before taxes. Produce output showing the calculated values including the total amount due for both 15% and the 20% tips. Tax of 9% should be added to the bill before the tip is determined. Write appropriate methods for your solution. Display subtotal showing the amount owed prior to applying a tip. Show each tip amount and the totals with each tip amount. Be sure to provide labels for values and number align them.

+5
Answers (1)
  1. 3 April, 22:37
    0
    using System;

    public class Test

    {

    public static void Main ()

    {

    / / your code goes here

    Console. Write ("/nEnter the total bill : ");

    double totalbeforetax = Convert. ToDouble (Console. ReadLine ());

    Console. Write ("/nEnter the tip percentage (10% or 15%) : ");

    double tip = Convert. ToDouble (Console. ReadLine ());

    double totalwithtax = totalbeforetax * (1+0.09);

    double tipamount = tip*totalwithtax/100;

    double total = totalwithtax + tipamount;

    Console. WriteLine ("/nTotal bill without tax: "+totalbeforetax);

    Console. WriteLine ("/nTotal bill with 9% tax: "+totalwithtax);

    Console. WriteLine ("/nTip Amount: "+tipamount);

    Console. WriteLine ("/nTotal bill with tax and tip: "+total);

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers