
package Chapter04;
import java.util.Scanner;
public class Exercise43 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("점수를 입력하세요.");
System.out.print("프로그래밍 기초: ");
int s1 = scanner.nextInt();
System.out.print("데이터베이스: ");
int s2 = scanner.nextInt();
System.out.print("화면 구현: ");
int s3 = scanner.nextInt();
System.out.print("애플리케이션 구현: ");
int s4 = scanner.nextInt();
System.out.print("머신러닝: ");
int s5 = scanner.nextInt();
int totla = s1 + s2 + s3 + s4 + s5;
System.out.println("총점: " + totla);
double e = (s1 + s2 + s3 + s4 + s5) / 5.0;
System.out.println("평균: " + e);
double score = e;
if (score >= 90) {
System.out.println("학점: A");
} else if (score >= 80) {
System.out.println("학점: B");
} else if (score >= 70) {
System.out.println("학점: C");
} else if (score >= 60) {
System.out.println("학점: D");
} else {
System.out.println("학점: F");
}
}
}
'Java > 과제' 카테고리의 다른 글
chapter04) 조건문과 반복문 example - 랜덤 숫자 맞추는 게임 프로그램 (0) | 2022.08.10 |
---|---|
chapter04) 조건문과 반복문 example - 가위바위보 게임 프로그램 (0) | 2022.08.10 |
chapter04) 조건문과 반복문 example - 특정 월을 입력 받은 후, 입력 받은 월의 계절이 어떤 계절인지 알아내는 프로그램 (0) | 2022.08.10 |
chapter04) 조건문과 반복문 example - 입력 받은 숫자로 삼각형을 만들 수 있는지 판별하는 프로그램 (0) | 2022.08.10 |
chapter03) 연산자 example - 입력 연도가 윤년인지 확인하는 프로그램 (0) | 2022.08.07 |