Question: Hello, I need help with my code. This is a FOR LOOP assignment. The code is supposed to calculate Gas Mileage. Right now my code

Hello,

I need help with my code. This is a FOR LOOP assignment. The code is supposed to calculate Gas Mileage. Right now my code Runs and Runs. Does not calculate. Assignment Instructions are below the code.

Hello, I need help with my code. This is a FOR LOOP

assignment. The code is supposed to calculate Gas Mileage. Right now my

code Runs and Runs. Does not calculate. Assignment Instructions are below the

package gasmileage; import java.util.Scanner; public class Gasmileage \& public static void main(String[] args) \& (param args the command line arguments // Calculate Gas Mileage int trips = l; int miles; double gallons, mpg; Scanner scan = new Scanner ( source:System. in); while(trips4.0 miles per gallon. Extra Credit: Instead of assuming 3 trips, ask the user how many trips he/she took

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!