글 작성자: 취업중인 피터팬
728x90
기본 환경
JDK : 1.8.0_261 버전
JRE : 1.8.0_261 버전
JAVA VERSION : 8 업데이트 261
Eclipse IDE VERSION : 2020-06버전

 

시나리오

세개의 과목 국어 89점, 영어 99점, 수학 78점 점수와 총점을 출력하는 프로그램을 만드시오


 

다음과 같은 결과 값이 나와야 합니다.

 

정답
package ex02variable;

public class Qu_02_01 {

	public static void main(String[] args) {
		int kor;
		int eng;
		int math;
		
		kor = 89;
		eng = 99;
		math = 78;
		
		int total = kor + eng + math;
		
		System.out.println("국어  : " + kor + " 영어 : " + eng + " 수학 : " + math);
		System.out.println("총점 : " + total);
	}

}