JAVA 프로그래밍

문제

국어 점수, 영어 점수, 수학 점수를 입력받아 평균을 계산하는 문제입니다 이를 해결하는 프로그램의 다음 실행상태에 대해 빈칸을 채우세요 

프로그램의 실행순서 및 실행상태

1  public static void main( String[] args ) {  

2   int korean = scan.nextInt();
0점 ~ 100점 사이의 국어 점수를 입력하세요: 90

3   int english = scan.nextInt();
0점 ~ 100점 사이의 영어 점수를 입력하세요: 89

4   int mathematics = scan.nextInt();
0점 ~ 100점 사이의 수학 점수를 입력하세요: 86

5   double average = (double)( korean + english + mathematics ) / 3;   
                           main()
scan  (Scanner) 
     korean
    english
mathematics
    average

6   System.out.printf( "국어 %d점, 영어 %d점, 수학 %d점의 평균은 %.2f점입니다.",   
국어 90점, 영어 89점, 수학 86점의 평균은 88.33점입니다.

7  }


프로그램 코드

	import java.util.Scanner;
	
	public class ScoreAverage
	{
1		public static void main( String[] args ) { 	
			Scanner scan = new Scanner( System.in );
			System.out.print( "0점 ~ 100점 사이의 국어 점수를 입력하세요: " );
2			int korean = scan.nextInt();
			System.out.print( "0점 ~ 100점 사이의 영어 점수를 입력하세요: " );
3			int english = scan.nextInt();
			System.out.print( "0점 ~ 100점 사이의 수학 점수를 입력하세요: " );
4			int mathematics = scan.nextInt();
			
5			double average = (double)( korean + english + mathematics ) / 3;			
			
6			System.out.printf( "국어 %d점, 영어 %d점, 수학 %d점의 평균은 %.2f점입니다.", 		
								korean, english, mathematics, average );
			scan.close();
7		}
	}