Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

First, launch NetBeans and close any previous projects that may be open (at the

ID: 3876306 • Letter: F

Question

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).

Then, create a new Java application called "DistanceCalc" (without the quotation marks) that requests two double values from the user at the command line:

amount of present fuel in gallons for the vehicle's fuel tank

the vehicle fuel efficiency (miles per gallon)

Compute how far, in miles, the vehicle can travel on the available fuel. Your program should output: "You are able to travel X.XX miles on remaining fuel." where X.XX is the miles distance you calculated.

Explanation / Answer

As per your requirement the below one is solution please follow it

Here is your DistanceCalc java application:

import java.util.Scanner;


public class DistanceCalc
{

  
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
double fuel,MilesPerGallon;
System.out.println("Enter present fuel(in gallons) in vehicle");
fuel=input.nextDouble(); //For user to enter fuel
System.out.println("Enter vehicle fuel efficiency(miles per gallon");
MilesPerGallon=input.nextDouble(); // For user to enter miles per gallons
System.out.println("You are able to travel "+fuel*MilesPerGallon+" miles on remaining fuel"); //To print the total miles can travel
}
  
}