3
Answers

I need this Program

Ya Boi

Ya Boi

7y
192
1

I need a program that includes two overloaded methods named DisplayTipInfo.

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

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

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.

For example if the input meal price is 30.00 and the tip is 0.20, the output should be:

Meal price: $30.00. Tip percent: 0.20 Tip in dollars: $6.00.  Total bill $36.00
My overloaded methods so far are:
static void Main()
public static void DisplayTipInfo(double price, double tipRate)
public static void DisplayTipInfo(double price, int tipInDollars)

Answers (3)
0
Chetan Ranpariya

Chetan Ranpariya

NA 1.6k 234 7y
If your maths is clear what you need to do is "var totalPrice = price + (price*tipRate);" and "var totalPrice = price + tipInDollars;" and display it where ever you want it.
0
Ya Boi

Ya Boi

NA 27 1.2k 7y
I just don't know how to do it, you mind walking me through it?
0
Chetan Ranpariya

Chetan Ranpariya

NA 1.6k 234 7y
You have created methods with proper signature. What issue you are facing in writing the method bodies?