Question: C# HINT/FRAMEWORK: using System; namespace SimpleLengthConversion { public class MilesToKm { public static void Main() { double miles = 0.0; double kilometres; miles = InputMiles();

C#C# HINT/FRAMEWORK: using System; namespace SimpleLengthConversion { public class MilesToKm { public

HINT/FRAMEWORK:

using System;

namespace SimpleLengthConversion { public class MilesToKm { public static void Main() { double miles = 0.0; double kilometres; miles = InputMiles(); kilometres = MilesToKilometres(miles); OutputResult(miles, kilometres); ExitProgram(); }

public static double InputMiles() { // Ask the user to type in a number in miles // ...

// Return the number the user typed in // ... }

public static double MilesToKilometres(double miles) { // Return the value 'miles' converted to kilometres // ... }

public static void OutputResult(double miles, double kilometres) { // Display the message "(miles) miles is equal to (kilometres) kilometres" // ... }

public static void ExitProgram() { // Prompt the user to press enter to close the window // ...

// Wait for the user to press enter Console.ReadLine(); } } }

For this task you are asked to write another conversion program: this time, converting miles to kilometres. As a special requirement for this task you are required to write your program using methods. The methods you are required to implement are given to you; you just need to fill them out. The Main) function has been written for you and is provided for your convenience. Your code will be run by calling the InputMiles(),MilesToKilometres( OutputResult() and ExitProgram() methods directly. As a result, make sure you make these methods public 1 mile 1.609344 kilometres ow nany niles? 100 0 niles is equal to 160.9344 kilometres ress enter to exit. A framework has been provided for your convenience in writing the program. The comments give you hints about the code you need to add to make the program work. The

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!