package CHAP02;

import java.util.Scanner; 

public class LAB02_FoodScoreCalculator { 
	
    public static void main(String[] args) {
    	
        Scanner scanner = new Scanner(System.in);
        
        // 첫 번째 재료의 맛 점수 입력
        System.out.print("첫 번째 재료의 맛 점수를 입력하세요 (0.0 ~ 10.0): ");
        double ingredient1 = scanner.nextDouble();
        
        // 두 번째 재료의 맛 점수 입력
        System.out.print("두 번째 재료의 맛 점수를 입력하세요 (0.0 ~ 10.0): ");
        double ingredient2 = scanner.nextDouble();
        
        // 평균과 조합 가중치 계산
        double combinationScore = (ingredient1 + ingredient2) / 2;

        // 두 재료의 맛 점수가 모두 7점 이상이면 추가 가중치 1.5점 부여
        combinationScore += (ingredient1 > 7 && ingredient2 > 7) ? 1.5 : 0;

        // 조합된 맛 점수 출력 (소수점 둘째 자리까지 표시)
        System.out.printf("두 재료의 조합 맛 점수는 %.2f 입니다.\n", combinationScore);
        
        scanner.close(); // Scanner 닫기 (리소스 해제)
    }
}
