국비교육/국비교육 복습
Day02_data_Test04 : 영화관 요금 계산
Luver Duck
2022. 7. 30. 16:06
(Q) 영화관 요금표는 다음과 같습니다
- 성인 : 12000원, 청소년 : 7500원
성인 2명과 청소년 3명이 영화를 볼 때 이용요금을 출력
package day02;
import java.lang.*;
public class Day02_data_Test04 {
public static void main(String[] args) {
int adultPrice = 12000;
int adultCount = 2;
int youthPrice = 7500;
int youthCount = 3;
int totalPrice = adultPrice * adultCount + youthPrice * youthCount;
System.out.println(totalPrice);
}
}