So I was looking at this problem , and in monodevelop (and Visual Studio). But for somereason I keep getting unreachable code or error in Visual Studio, I retyped and relooked over my code but I cant seem to find what the mistake is that I can run my code.
I think the problem has a typo or done wrong....
using System;
namespace MilesPerGallon
{
class MainClass
{
public static double CalculateMilesPerGallon
(int milesTraveled, double gallonsUsed)
{
return milesTraveled / gallonsUsed;
Console.WriteLine("Miles Per Gallon = {0:N2}", CalculateMilesPerGallon(289, 12.2));
Console.Read();
}
}
}