Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the algorithm table to calculate a tip to leave a waiter. The program s

ID: 3844054 • Letter: C

Question

Complete the algorithm table to calculate a tip to leave a waiter. The program should subtract the liquor and 7% tax from the total bill and then calculate the tip (using a percentage) on the remainder. The user will enter the total bill, liquor amount, and tip percent. Desk check using $100 as total bill, $20 for liquor, and a 20% tip. When finished submit this document (not zipped) into Blackboard and submit hard copy in class. Field names are descriptive names in camel case.

I need the Algorithm table.

Explanation / Answer

Algorithm

1-) Take total_bill, liquor and tip from user

2-) Calculate part_bill = total_bill - liquor part_bill2 = part_bill - part_bill*0.07

3-) Calculate the tip tip_amount = part_bill2 * (tip/100)

4-) return tip_amount

5-)end

PROGRAM

using System;

public class Bill
{
double total_bill, liquor, tip, tip_amount;
   public static void Main()
   {
Bill bill = new Bill();
bill.Input();
bill.tip_amount = (bill.total_bill - (bill.liquor + (bill.total_bill*0.07) ))*(bill.tip/100);
Console.WriteLine("Tip = {0}",bill.tip_amount);
  
   }
   public void Input(){
   Console.WriteLine("Enter the total bill : ");
   total_bill = Convert.ToDouble(Console.ReadLine());
   Console.WriteLine("Enter the liquor amount : ");
   liquor = Convert.ToDouble(Console.ReadLine());
   Console.WriteLine("Enter the tip in % : ");
   tip = Convert.ToDouble(Console.ReadLine());
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote