Question: Please can someone give me a good Algorithm Pseudocode or Flowchart of this following java code / * * * * / public class WeatherTracker

Please can someone give me a good Algorithm Pseudocode or Flowchart of this following java code
/**
*
*/
public class WeatherTracker {
/**
* @param args
*/
@SuppressWarnings("resource")
public static void main(String[] args){
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("Welcome to the Weather App Program!!");
System.out.println("This program will determine the categories of weather temperatures.");
System.out.println("Enter the number of days you want to enter:");
int days = input.nextInt();
int[] temperatures = new int[days];
int hotDays =0, niceDays =0, moderateDays =0, coldDays =0;
double total =0;
for (int i =0; i < days; i++){
System.out.println("Enter temperature "+(i +1)+":");
temperatures[i]= input.nextInt();
total += temperatures[i];
if (temperatures[i]>=85){
hotDays++;
} else if (temperatures[i]>=70){
niceDays++;
} else if (temperatures[i]>=50){
moderateDays++;
} else {
coldDays++;
}
}
double average = total / days;
System.out.println("Hot Days: "+ hotDays);
System.out.println("Nice Days: "+ niceDays);
System.out.println("Moderate Days: "+ moderateDays);
System.out.println("Cold Days: "+ coldDays);
System.out.println("The average temperature was "+ average +" degrees.");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!