Practice writing and calling methods by building a unit converter. You'll create separate methods for each conversion and a menu to let the user choose which one to run.
YOUR TASK
Create a program with:
A method MetersToFeet(double m) that returns m * 3.28084
A method FeetToMeters(double f) that returns f / 3.28084
A menu: 1. Meters to Feet, 2. Feet to Meters
Reads a value and prints the result (e.g. Result: 3.28)
Need a hint?
Step-by-step:
1. Define methods outside Main: static double MetersToFeet(double m) { return m * 3.28084; }
2. In Main, print the menu and read choice
3. Call the right method and print with Console.WriteLine($"Result: {result:F2}");
Example (input: 1 then 1):
1. Meters to Feet
2. Feet to Meters
Choose: 1
Enter value: 1
Result: 3.28
Code Editor Ready
Output
Console
Console initialized...
Ready for Project 5: Unit Converter
> Test input: choose option 1, then enter value 1
> 1 meter = 3.28 feet — make sure that appears!
> When it passes, the Complete button will activate!