Answer:
<em>Java</em>
//////////////////////////////////////////////////////////////////////////
import java.util.Scanner;
public class MyClass {
public static void main(String args[]) {
double miles_gallon, gas_gallon;
////////////////////////////////////////////////
System.out.print("Enter miles per gallon: ");
Scanner myObj = new Scanner(System.in);
miles_gallon = myObj.nextDouble();
System.out.print("Enter gas dollars per gallon: ");
gas_gallon = myObj.nextDouble();
System.out.println();
////////////////////////////////////////////////
double twenty_miles = 20/miles_gallon*gas_gallon;
System.out.printf("Gas cost for 20 miles: $%.2f%n%n", twenty_miles);
double seventy_five_miles = 75/miles_gallon*gas_gallon;
System.out.printf("Gas cost for 75 miles: $%.2f%n%n", seventy_five_miles);
double five_hundered_miles = 500/miles_gallon*gas_gallon;
System.out.printf("Gas cost for 500 miles: $%.2f", five_hundered_miles);
}
}