163k views
4 votes
Given the already defined variables temperature and humidity, write an expression that evaluates to True if and only if temperature is greater than 90 and humidity is less than 10.

1 Answer

5 votes

Answer:

if(temperature>90 &&humidity<10)

Step-by-step explanation:

A complete program in java that requests user to enter the value for temperature and humidity is given below. If the above condition is true it outputs "TRUE" else it outputs "FALSE"

import java.util.Scanner;

public class num8 {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

System.out.println("enter temperature and humidity");

double temperature = in.nextDouble();

double humidity = in.nextDouble();

if(temperature>90 &&humidity<10){

System.out.println("TRUE");

}

else

{

System.out.println("FALSE");

}

}

}

User Monea
by
5.8k points