Hi Everyone, I've been working on creating this code for a project I've been working on but I can't seem to get it to work. I'm creating a service class that I can then pass to a client class that will read a list of cities that ends in a "*" and then for each city read a list of tempratures that ends with a "0". It then has to calculate the average temprature, highest and lowest, and then output them along with any tempratures over 100. I've talked to my professor and she told me that the solution is a nested while loop, and that the prompts for the final program should be in a seprate client class.
public class WeatherInput
{
private static double tempAverage = 0;
private static double tempHigh = 0;
private static double tempLow = 0;
private static double tempHundred = 0;
public static String newCity = new String();
public static String city = new String();
public static void tempCalc(double temp)
{
while(city != *)
{
city = newCity;
}
while(temp != 0)
{
tempAverage = (temp + temp)/2;
if(tempHigh > temp)
tempHigh = temp;
if(tempLow < temp)
tempLow = temp;
if(temp > 100)
tempHundred = temp;
temp++;
}
System.out.print(tempAverage);
}
}