Question: Fix the error compile and run // Program Lablc.java Program Lab1c.java // Demonstrate the use of the Scanner class to read numeric data. import java.util.Scanner;
Fix the error compile and run

// Program Lablc.java Program Lab1c.java // Demonstrate the use of the Scanner class to read numeric data. import java.util.Scanner; public class LablC { // Calculates fuel efficiency based on values entered by the user. public static void main(String[] args). { int miles; double gallons, mpg; Scanner scan = new Scanner (System.in); System.out.print ("Enter the number of miles: "); miles scan.nextInt(); System.out.print ("Enter the gallons of fuel used: "); scan.nextDouble (); gallons = mpg = miles * gallons; } System.out.println ("Miles Per Gallon: " + mpg);
Step by Step Solution
There are 3 Steps involved in it
The below error exist in the provided code of the program The formul... View full answer
Get step-by-step solutions from verified subject matter experts
