Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created November 14, 2013 07:17
Show Gist options
  • Save pepet96/7462739 to your computer and use it in GitHub Desktop.
Save pepet96/7462739 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
class TirePressure {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
System.out.println("Pressure of the right front tire: ");
double rf = input.nextDouble();
System.out.println("Pressure of the left front tire: ");
double lf = input.nextDouble();
System.out.println("Pressure of the right rear tire: ");
double rr = input.nextDouble();
System.out.println("Pressure of the left rear tire: ");
double lr = input.nextDouble();
if (rf == lf) System.out.println("Tire pressure in your front tires is ok.");
else System.out.println("Tire pressure in your front tires is not ok.");
if (rr == lr) System.out.println("Tire pressure in your rear tires is ok.");
else System.out.println("Tire pressure in your rear tires is not ok.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment