Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm missing the $ into my values HELP ME CODE Programming Exercise 8-4 X Instructions >_ Terminal + A-Z Create a program named TipCalculation that

image text in transcribed

I'm missing the $ into my values

HELP ME CODE

Programming Exercise 8-4 X Instructions >_ Terminal + A-Z Create a program named TipCalculation that includes two overloaded methods named DisplayTipInfo. Meal price: $30.00. Tip percent: 0. 20 Tip in dollars: A6.00. Total bill a 36.00 Meal price: 230.09. Tip percent: 0. 13 Tip in dollars: 14.00. Total bill a 34.00 6 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). bongo TipCalculation.cs + 1 using System; 2 using static System.Console; 3 using System. Globalization; 4 class TipCalculation 5 { 6 static void Main() 7 { 8 double price - 30.00; 9 double tipRate - 0.2e; 10 int tipInDollars = 4; 11 DisplayTipInfo(price, tipRate); 12 DisplayTipInfo(price, tipInDollars); 13 } 14 15 public static void DisplayTipInfo(double price, double tipRate) 16 { 17 double tipInDollars - price * tiprate; 18 double total = price + tipInDollars; 19 WriteLine("Meal price: {@}. Tip percent: {1}", 20 price.ToString("C"), tipRate.ToString("F2")); 21 WriteLine("Tip in dollars: {@}. Total bill {1}", 22 tipInDollars.ToString("C"), total.ToString("C")); 23 } 25 public static void DisplayTipInfo(double price, int tipInDollars) 26 { 27 double tiprate - tipInDollars / price; 28 double total - price + tipInDollars; 29 WriteLine("Meal price: {@}. Tip percent: {1}", 30 price.ToString("C"), tipRate.ToString("F2")); WriteLine("Tip in dollars: {@}. Total bill {1}", 32 tipInDollars.ToString("C"), total.ToString("C"));|| 33 34) 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. 24 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.6 31 35 In order to prepend the sto currency values, the program will need to use the Culture Info.GetCulture Info method. In order to do this, include the statement using Systen. Globalization; at the top of your program and format the output statements as follows: WriteLine("This is an example: {0}", value. ToString("C". CultureInfo.GetCulture Info("en- US")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago