Re: Help WA Test #7
Hi,
Alright guys I have solved the problem. Being a newbie to c# caused me to submit program 35 times. I didn't realize that Math.Round() function will change 100.00 to 100 instead. Here are the lines which I changed.
double miles = distance(ship_latitude_radian, ship_longitude_radian, iceberg_latitude_radian, iceberg_longitude_radian);
if (Math.Round(miles, 2) < 100.00)
{
Console.WriteLine("The distance to the iceberg: {0:F2} miles.", miles);
Console.WriteLine("DANGER!");
}
else
{
Console.WriteLine("The distance to the iceberg: {0:F2} miles.", miles);
}