Question: import java.util.Scanner; public class JLynch { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System .
import java.util.Scanner;
public class JLynch
public static void mainString args
Scanner scanner new ScannerSystemin;
String cities new String;
int snowfalls new int;
double totalSnowfall ;
double avgsnowfall;
Input city names and snowfall amounts
for int i ; i ; i
System.out.printlnEnter city name: ;
citiesi scanner.nextLine;
System.out.printlnEnter snowfall amount in inches for citiesi: ;
snowfallsi scanner.nextInt;
scanner.nextLine; to handle the newline character
Display city names and snowfall amounts
System.out.println
Snowfall amounts:";
for int i ; i ; i
System.out.printlncitiesi: snowfallsi inches";
totalSnowfall snowfallsi;
Compute the average snowfall
avgsnowfall totalSnowfall;
System.out.printlnTotal Snowfall totalSnowfall inches";
System.out.printlnAverage Snowfall avgsnowfall inches";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
