Problem 1:
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.
#Compute #miles #vehicle #travel #fuel #program #output #travel #X.XX #miles #remaining #fuel #X.XX #miles #distance #calculated
How useful was this post?
Click on a star to rate it!
Average rating 0 / 5. Vote count: 0
No votes so far! Be the first to rate this post.