package jp.co.jid.conditionalBranch;

public class Exercises03 {

	private static final int ADULT_MAN_PRICE = 9000;
	private static final int ADULT_WOMAN_PRICE = 7000;
	private static final int FREE_AGE = 2;
	private static final int HALF_AGE = 12;
	private static final int MAN = 1;
	private static final int WOMAN = 2;

	public static void main(String[] args) {
		int age = 10;
		int sex = MAN;
		int price = (sex == MAN ? ADULT_MAN_PRICE : ADULT_WOMAN_PRICE);

		if (age <= FREE_AGE) {
			price = 0;
		} else if (age <= HALF_AGE) {
			price /= 2;
		}
		System.out.println(age + "歳の宿泊料金は" + price + "円です");
	}

}
