wahaj
- 154
- 2
Homework Statement
I'm making a program which will convert mph to minutes and seconds per mile. For example my program will take 6.5 mph and convert it to 9 minutes and 13.8 seconds per mile. But being new to programming I don't know how to convert a double value to an int value (I believe its called casting). So the book gives me the following formula/ equation
intValue = static_cast<int>(dblVal);
if I have the variable speed = 9.23 (thats 6.5 mph converted to miles per min) and I want to store the integer part in another variable called speedM , where in the above equation do I put speed and speedM?