Question

in C# Write an object-oriented program that can be used to determine the tip amount that...

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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

// 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}\n\n", finalTip);
        }
    }
}

/*
output:

Enter total amount:                                                    
100                                                                    
Tip: 16.35

*/

Add a comment
Know the answer?
Add Answer to:
in C# Write an object-oriented program that can be used to determine the tip amount that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Bill and Tip Calculator Write a C program to generate a receipt for a restaurant. Your...

    Bill and Tip Calculator Write a C program to generate a receipt for a restaurant. Your application should allow the user to enter the bill amount and allow them to decide if they would like to leave a 15 percent tip or not. ▪ Do not allow the user to enter a negative value for the bill. ▪ Display the bill amount, tax amount, tip amount, and total amount. ▪ To calculate the tip, multiply the bill amount by 0.15....

  • Write a C  program that computes the tax and tip on a restaurant bill for a patron...

    Write a C  program that computes the tax and tip on a restaurant bill for a patron with a $88.67 meal charge. The tax should be 6.75 percent of the meal cost. The tip should be 20 percent of the total after adding the tax. Display the meal cost, tax amount, tip amount, and total bill on the screen.

  • write a java code to calculate a restaurant tip based on the diner’s satisfaction on a...

    write a java code to calculate a restaurant tip based on the diner’s satisfaction on a scale of 1 – 5. The user will input the total bill and their rating. The program should output the tip percentage, tip amount, and total due. You must use a select statement instead of an if. For a rating of 1, calculate a 10 % tip. For a rating of 2, calculate a 12.5% tip. For a rating of 3, calculate a 15...

  • Python Simple Programming Write a program in Python that calculates the tip and total for a...

    Python Simple Programming Write a program in Python that calculates the tip and total for a meal at a restaurant. When your program is run it should ... Calculate the tip and total for a meal for a restaurant Print the name of the application "Tip Calculator" Get input from the user for cost of meal and tip percent Print the tip and total amounts. The formula for calculating the tip amount is: tip = cost of meal * (tip...

  • CIT 238 – Android Programming I Tip Calculator Create an app that will compute the tip...

    CIT 238 – Android Programming I Tip Calculator Create an app that will compute the tip on a restaurant bill. App should contain: • An EditText to allow the user to enter the total amount of the bill • RadioButtons to allow the user to select one of the given tip percentages o 10% tip o 15% tip o 20% tip • A Button to calculate the amount of the tip. • A TextView to display the tip amount (tip...

  • Write a C++ program that will calculate the total amount of money for book sales at...

    Write a C++ program that will calculate the total amount of money for book sales at an online store. For each sale, your program should ask the number of books sold and then the price for each book and the shipping method (‘S’ for standard shipping and ‘E’ for expedited shipping). The program will produce a bill showing the subtotal, the sales tax, the discount, the shipping charge, and the final total for the sale. The program will continue processing...

  • IN C# Write a program to help a local restaurant automate its lunch billing system. The...

    IN C# Write a program to help a local restaurant automate its lunch billing system. The program should do the following: Show the customer the different lunch items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following lunch items (the price of each item is shown to the right of the item): Ham and Cheese Sandwich $5.00 Tuna Sandwich $6.00 Soup...

  • Write a C++ program that calculates the discount of the original price of an item and...

    Write a C++ program that calculates the discount of the original price of an item and displays the new price, and the total amount of savings. This program should have a separate header (discount.h), implementation (discount.cpp) and application files (main.cpp). The program must also have user input: the user must be prompted to enter data (the original price, and the percent off as a percentage). There must also be a validation, for example: Output: “Enter the original price of the...

  • In C++ Programming Write a program in to help a local restaurant automate its breakfast

    Write a program to help a local restaurant automate its breakfast billing system. The program should do the following:Show the customer the different breakfast items offered by the restaurant.Allow the customer to select more than one item from the menu.Calculate and print the bill.Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item):Use an array menuList of type menuItemType, as defined in Programming Exercise 3. Your program must contain at least the...

  • Language - PYTHON Design a program that calculates the total amount of a meal purchased at a restaurant

    Language - PYTHONDesign a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15% tip and 7% sales tax. Display each of these amounts and the total.Please help, I have no idea where to begin. Thanks

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT