that average july high temperature is 85 degrees fahrenheit in new york, 88 degrees fahrenheit in denver, and 106 degrees fahrenheit in phoenix. write a program that calculates and reports what the new average july high temperature would be for each of these citites if temperature rise by 2 percent.

Respuesta :

ijeggs

Answer:

public class num8 {

   public static void main(String[] args) {

       System.out.println("Average Temperature in New York is 85 degrees fahrenheit");

       System.out.println("Average Temperature in Denver is 88 degrees fahrenheit");

       System.out.println("Average Temperature in Phoenix is 106 degrees fahrenheit");

   // Calculating the new average Temperatures

       System.out.println("The New Average Temperature in New York " +

               "is "+ ((0.02*85)+85 )+ " degrees fahrenheit");

       System.out.println("The New Average Temperature in Denver " +

               "is " +((0.02*88)+88 )+ " degrees fahrenheit");

       System.out.println("The New  Average Temperature in Phoenix " +

               "is "+((0.02*106)+106 )+ " degrees fahrenheit");

   }

}

Explanation:

  1. Using Java first display the previous average temperatures for the three cities as given in the question
  2. Then calculates the new average temperature by multiplying by 0.02, because of a 2 percent increase in the average temperature
  3. Display the new temperature using the System.out,println