0
How can I solve this activity/ Write simpler code
Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). (First code is the original) https://code.sololearn.com/cyy8560NO08o/?ref=app
3 Antworten
+ 2
Hy,
You have to just define MphAndMinutesToMiles() function and return milesTraveled
refer following code:
https://code.sololearn.com/cXwVCgvT8576/#cpp
+ 1
Just declare & define a function with the name you want, if you want simpler code, you can make the function in only 1 line since the calculation only take double as the type (you also don't need to declare another variable, optional). The conclusion is, you just make a function with the name MphAndMinutesToMiles with double as its return type and both the parameters.
Here's yours, edited:
https://code.sololearn.com/ceX9YZ4egHaL/?ref=app
+ 1
thank you so much!!!!