Challenge: Converting Kilometers to Miles
Taak
Swipe to start coding
You are traveling from San Francisco to New York. The distance between them is approximately 4677.4 kilometers. You want to calculate the distance in miles.
- Convert the distance from kilometers to miles by dividing
distance_in_kilometers
by 1.609. Store the result in the variabledistance_in_miles
. - Create a variable called
int_distance_in_miles
to store the integer distance in miles. - Convert the value of
distance_in_miles
to an integer and store it in the variableint_distance_in_miles
.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 2. Hoofdstuk 5