Answer:
<em>This question is answered using C++ programming language.</em>
<em>This program does not make use of comments; However, see explanation section for detailed line by line explanation.</em>
<em>The program starts here</em>
#include <iostream>
using namespace std;
int main()
{
double quantity,seconds;
int minutes;
cout<<"Quantity (mph): ";
cin>>quantity;
minutes = int(60/quantity);
cout<<minutes<<" minutes and ";
seconds = (60/quantity - int(60/quantity))*60;
printf("%.1f", seconds);
cout<<" seconds per mile";
return 0;
}
Explanation:
The following line declares quantity, seconds as double datatype
double quantity,seconds;
The following line declares minutes as integer datatype
int minutes;
The following line prompts user for input in miles per hour
cout<<"Quantity (mph): ";
User input is obtained using the next line
cin>>quantity;
The next line gets the minute equivalent of user input by getting the integer division of 60 by quantity
minutes = int(60/quantity);
The next statement prints the calculated minute equivalent followed by the string " minuted and " without the quotes
cout<<minutes<<" minutes and ";
After the minutes has been calculated; the following statement gets the remainder part; which is the seconds
seconds = (60/quantity - int(60/quantity))*60;
The following statements rounds up seconds to 1 decimal place and prints its rounded value
printf("%.1f", seconds);
The following statement prints "seconds per mile" without the quotes
cout<<" seconds per mile";