"Climate Today is a media company that provides commercial weather forecasting services. They have a list of temperatures for a particular location for N days and have already prepared the forecast report within the range L to R where L is the minimum temperature and R is the maximum temperature from the given list. Now, "ClimateToday needs to know the temperature for the days that are not included within the range L to R. Write an algorithm to help the company prepare the list of temperatures that are not induded in the range L to R.
Answers
Answered by
1
Climate Today is a media company that provides commercial weather forecasting services.
They have a list of temperatures for a particular location for N days and have already prepared the forecast report within the range.
L to R where L is the minimum temperature and R is the maximum temperature
Explanation:
- the range L to R where L is the minimum temperature and R is the maximum temperature from the given list.
- Climate Today needs to know the temperature for the days that are not included within the range L to R.
- The company needs the forecasting whether to detect of the values of the L and R. If L is minimum then the value of the R should be maximum and vice versa.
Answered by
0
Answer:
java 8
Explanation:
import java.util.Scanner;
public class ClimateToday {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int days = scan.nextInt();
int[] temp = new int[days];
int min = scan.nextInt();
int max = scan.nextInt();
for(int i=0;i<days;i++) {
temp[i] = scan.nextInt();
}
for(int i=0;i<days;i++) {
if(temp[i]<min || temp[i]>max) {
System.out.print(temp[i]+" ");
}
}
}
}
Similar questions