Wednesday, January 28, 2015

C# I need help With the code for class.

Hi banditblue63,


As far as I know, one mile is equal with 5280 feet. If you want to convert 4.5 miles to feet, you could use the statement “4.5*5280” instead of “4.5/5280”. The type of mile could be double and the type of feet could be int. you could try the code below



private void Form0129_Load(object sender, EventArgs e)
{
int a = MilesToFeet(4.5);
}
public int MilesToFeet(double Miles)
{
return Convert.ToInt32(Miles*5280);
}

If you have any further questions, please feel free to post in this forum.


Best Regards,


Edward




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.



No comments:

Post a Comment