3초기억력

클래스 : 영화등급 점수 본문

자바_기초

클래스 : 영화등급 점수

잠수콩 2019. 5. 21. 17:11
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
// 영화의 등급은 대본 script, 연기 action, 감독 directing 점수로 결정된다.
// 각 분야 10점 만점.

package HomeWork;


public class MovieRating {

	public static String Movie(int a, int b, int c){
		
		int script = a;
		int action = b;
		int directing = c;
		
		String movieRating;
		
		int total = script + action + directing;
		
		if (total >= 0 && total < 11) {
			movieRating = "C등급";
		} else if (total >= 10 && total < 21) {
			movieRating = "B등급";
		} else {
			movieRating = "A등급";
		}
		
		return movieRating;
		
	}

	public static void main(String[] args) {

		String movieRating = Movie(1,1,5);
		
		System.out.println("영화등급 : "+ movieRating);
		
		String movieRating2 = Movie(10,4,5);
		
		System.out.println("영화등급 : "+ movieRating2);
		
		String movieRating3 = Movie(10,10,10);
		
		System.out.println("영화등급 : "+ movieRating3);

	}

}
Comments