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

Programming Exercise 8-4 Due Today at 11:59 PM CDT TipCalculation.cs TipCalculat

ID: 3704937 • Letter: P

Question

Programming Exercise 8-4 Due Today at 11:59 PM CDT TipCalculation.cs TipCalculation that includes two overloaded methods named DisplayTipInfo. 1 using static System.Console; 2 class TipCalculation One should accept a meal price and a tip as doubles (for example, 30.00 and 0.20, where 0.20 represents a 20 percent tip) 4static void Main() // Write your main here 7 The other should accept a meal price as a double and a tip amount as an integer (for example, 30.00 and 5, where 5 represents a $5 tip) 9 10 public static void DisplayTipInfo (double price, double tipRate) public static void DisplayTipInfo (double price, int tipInDollars) Each method displays the meal price, the tip as a percentage of the meal price, the tip in dollars, and the total of the meal plus the tip Include a Main) method that demonstrates each method 12 13 14 15 16 For example if the input meal price is 30.00 and the tip is 0.20, the output should be Run Code Test Grade

Explanation / Answer

using System.IO;
using System;

class Reverse3
{
static void Main()
{
Console.WriteLine("Enter the meal price: ");
double price = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the tip rate: ");
double tipRate = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the meal price: ");
double price2 = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the tip rate: ");
double tipDollors = Convert.ToInt32(Console.ReadLine());
DisplayTipInfo(price, tipRate);
DisplayTipInfo(price2, tipDollors);
  
}
public static void DisplayTipInfo(double price, double tipRate) {
Console.WriteLine("Price: "+price+" Tip : "+(price*tipRate));
}

public static void DisplayTipInfo(double price, int tipDollors) {
Console.WriteLine("Price: "+price+" Tip : "+(tipDollors));
}
}

Output: