Ask Question
2 June, 12:33

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.

+1
Answers (1)
  1. 2 June, 13:46
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers