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.

Respuesta :

Answer:

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);

}

}

Explanation: