Professional Documents
Culture Documents
Gambarkan Flowgraph Utk Flowchart Berikut Ini
Gambarkan Flowgraph Utk Flowchart Berikut Ini
Gambarkan Flowgraph Utk Flowchart Berikut Ini
import java.io.*;
import java.text.*;
}//for j
System.out.println();
}//for i
//menu
int choice=0;
while (choice == 0)
{ System.out.println("Stats for");
System.out.println("\t1. Rain");
System.out.println("\t2. Wind");
System.out.println("\t3. Sun\n");
System.out.println("\tChoice: ");
try{
choice = Integer.parseInt(keyb.readLine());
}
//reports
int total = 0;
switch (choice)
{ case 1: //average rain
for(i=0; i<NumberOfDays; i++)
{ total = total + wData[i][0];
}//for i
System.out.println("\nAverage Rain = " + total/NumberOfDays);
break;
case 2: //average wind
for(i=0; i<NumberOfDays; i++)
{ total = total + wData[i][1];
}//for i
System.out.println("\nAverage WindSpeed = " + total/NumberOfDays);
break;
case 3://average sun
for(i=0; i<NumberOfDays; i++)
{ total = total + wData[i][2];
}//for i
System.out.println("\nAverage Hours Sun = " + total/NumberOfDays);
break;
default: choice = 0;
}//switch
}//while
System.out.println();
}//main
}//Weather