Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

This is the code I have right now. Can someone help explain what im doing wrong and how to solve this? using System; using static

image text in transcribed This is the code I have right now. Can someone help explain what im doing wrong and how to solve this?

using System;

using static System.Console;

using System.Globalization;

class MoveEstimator

{

static void Main()

{

const double hourlyRate = 150.00;

const double mileRate = 2.00;

const double baseRate = 200.00;

int mileage;

int hours;

double total;

WriteLine("Enter hours for trip: ")

hours = ReadLine();

WriteLine("Enter the number of miles: ")

mileage = ReadLine();

total = baseRate + (mileRate * mileage) + (hourlyRate * hours);

WriteLine("For a move taking {0} and going {1} miles the estimate is {3}",hours, mileage, total,

total.ToString("C",

CultureInfo.GetCultureInfo("en-US")));

}

}

Malcolm Movers charges a base rate of $200 per move plus $150 per hour and \$2 per mile. Write a program named MoveEstimator that prompts a user for and accepts estimates for the number of hours for a job and the number of miles involved in the move and displays the total moving fee. For example, if 25 hours and 55 miles are input the output would be displayed as: For a move taking 25 hours and going 55 miles the estimate is $4,060.00 In order to prepend the $ to currency values, the program will need to use the method. In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements as follows: WriteLine("This is an example: {} ", value. Tostring( "C", CultureInfo. GetCultureInfo("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_2

Step: 3

blur-text-image_3

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

More Books

Students explore these related Databases questions