Ask Question
17 October, 07: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.

+3
Answers (1)
  1. 17 October, 07:36
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers