I have to have the tire pressure of the two back wheels the same and the two back wheels the same but it doesnt seem to be working.

public class Pressure
{
	private int fr;
	private int fl;
	private int br;
	private int bl;
	
	public Pressure()
	{
		
	}
	public void getPressure()
	{
		if(fr == fl && br==bl)
			System.out.println("Your tire pressure is ok.");
		else
			
			System.out.println("Your tire pressure is not ok.");
	
	
	}
}
import java.util.Scanner;
	public class PressureTester
	{
		public static void main(String[]args)
		{
		Scanner in = new Scanner(System.in);
		
		System.out.println("Pressure of Front Right tire.");
		int fr = in.nextInt();
		
		System.out.println("Pressure of Front Left tire.");
		int fl = in.nextInt();
		
		System.out.println("Pressure of Back Right tire.");
		int br = in.nextInt();
		
		System.out.println("Pressure of Back Left tire.");
		int bl = in.nextInt();
		
		Pressure set1 = new Pressure();
		
		System.out.println(set1.getPressure());
		
		
		
		
		}
	}

You have to pass your tire pressures as parameters to the constructor. You also have to modify your constructor so that it will take the parameters, and you also have to set your Pressure class's instance variables to the values you pass in when you call the constructor.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.