Menu



Manage

Cord > Study_JAVA 전체 다운로드
파일 목록
Study_JAVA > 4/ConditionIf.java Lines 27 | 653 바이트
다운로드

                        package week4;

import java.util.Scanner;

public class ConditionIf {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		System.out.println("Input you birth year ");
		
		int year = sc.nextInt();
		int toyee = 2023;
		
		if (toyee - year <= 26 && toyee - year >= 8) {
			if (toyee -year >= 20) {
				System.out.println("대학생");
			} else if (toyee - year >= 17) {
				System.out.println("highschool");
			} else if (toyee - year >= 14) {
				System.out.println("midleschool");
			} else System.out.println("Jamin");
		} else System.out.println("U R not student!");
		
		sc.close();
	}
}