Need help on this MPG program
Hi all,
The purpose of this program is listed in
// Inputs the miles driven and gallons used (both integers) for each tankful.
// Calculates and displays miles per gallon obtained for each tankful and print
// the combined miles per gallon obtained for all tankfuls up to this point.
// All results should be floating point. Use Scanner and sentinel-controlled
// repetition to obtain data from the user.
// Exercise 4.17 MPG.java
import java.util.Scanner;
public class MPG
{
private int milesDriven;
private int gallonsUsed;
private float result;
public void setMilesDriven( int miles )
{
milesDriven = miles;
}
public void setGallonsUsed( int gallons )
{
gallonsUsed = gallons;
}
public String getMilesDriven( int miles )
{
return milesDriven; // error occurs here
}
public String getGallonsUsed( int gallons )
{
return gallonsUsed;
}
public MPG( float result )
{
result = gallons * miles;
System.out.printf( result);
}
}
I try to compile this program, but the error I get is "incompatible types-found int but expected java.lang.String. How do I fix this, and how do I sentinel control? If you can help me with these two things, I'd appreciate it.

