nnual Weather client class
*
* @author Rayaan Khan
* @version 1/10/22
*/
import java.util.Scanner;
public class CityWeatherTesterV2
{
// method to print results (formatting output will be done in 6.02)
//Output: display table of weather data including average and total
//System.out.println();
//System.out.println(" Weather Data");
//System.out.println(" Location: " + city +", " + state);
//System.out.println("Month Temperature (" + tempLabel + ")
Precipitation (" + precipLabel + ")");
//System.out.println();
//System.out.println("***************************************************");
//for( int index = 0; index < temperature.length; index++)
//{
// use printf to format
//}
//System.out.println("Average: " + " Total: ");
public static void main(String [ ] args)
{
//Declare and initialize variables
Scanner in = new Scanner(System.in); //will be used in 6.02
String city = "Miami"; //choose a city from the table provided
String state = "Florida"; //choose a city from the table provided
String[] month = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }; //complete initialization of months array
double[] temperature ={68.1, 69.1, 72.4, 75.7, 79.6, 82.4, 83.7, 83.6,
82.4, 78.8, 74.4, 69.9}; //complete initialization of temperatures array
double[] precipitation ={1.9, 2.1, 2.6, 3.4, 5.5, 8.5, 5.8, 8.6, 8.4, 6.2,
3.4, 2.2}; //complete initialization of precipitation array
String tempLabel = "F"; //initialize to F
String precipLabel = "in"; //initialize to in
//input to decide F/C and in/cm - to be completed in 6.02
System.out.println("Choose temperature scale (F/C); ");
String userTemp=in.next();
System.out.println("Choose precipitation Scale (in/cm): ");
String userPrecip=in.nextLine();This study source was downloaded by 100000880630195 from CourseHero.com on 03-06-2024 00:07:11 GM