in C Write an objectoriented program that can be used to det

in C#

Write an object-oriented program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the total, before the taxes (9% of the total) and the tip charge of 15%. Produce output showing the calculated total amount due. Tax should be added to the bill before the tip is determined.

i will rate if correct

Solution

// C# code tip calculator

using System;

namespace TipCalculator
{
    class Program
    {
        static void Main(string[] args)
        {          
            Console.WriteLine(\"Enter total amount: \");
            double total = Convert.ToDouble(Console.ReadLine());
            double tippercentage = 0.15;
            double tax = 0.09;
          
           double finalTip = total*(1+tax)*tippercentage;

            Console.WriteLine(\"Tip: {0:C}\ \ \", finalTip);
        }
    }
}

/*
output:

Enter total amount:                                                    
100                                                                    
Tip: 16.35

*/

in C# Write an object-oriented program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the tot

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site