Answer:
const double gasDollarPerGallon = 20 ;
float calCost( double milesPerGallon ) {
double costPerGallon = milesPerGallon / gasDollarPerGallon;
System.out.printf ("%.2f/n", &costPerGallon);
int main ( ) {
scanf ("%2f", &gasDollarPerGallon) ;
calCost( 20 );
calCost( 75 );
calCost( 500 );
Step-by-step explanation:
The C source code above gets the user input of the gas dollar per gallon from the command prompt and divides the miles per gallon variable in the function call to get the cost of gas for the range of miles. It is also print out as a double with two places.