@@ -0,0 +1,174 @@
+import { christmasInstance } from "./InputView.js";
+import menuAndQuantity from "./utils/menuAndQuantity.js";
+
+const MENUS_PRICE = {
+  양송이수프: 6000,
+  타파스: 5500,
+  시저샐러드: 8000,
+  티본스테이크: 55000,
+  바비큐립: 54000,
+  해산물파스타: 35000,
+  크리스마스파스타: 25000,
+  초코케이크: 15000,
+  아이스크림: 5000,
+  제로콜라: 3000,
+  레드와인: 60000,
+  샴페인: 25000,
+};
+const WEEKDAY = [
+  3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31,
+];
+const WEEKEND = [1, 2, 8, 9, 15, 16, 22, 23, 29, 30];
+const STAR_DAY = [3, 10, 17, 24, 25, 31];
+
+export function toTalPriceLogic() {
+  const MENUS = christmasInstance.getMenus();
+  let totalPrice = 0;
+
+  MENUS.forEach((menu) => {
+    const { MENU_NAME, QUANTITY } = menuAndQuantity(menu);
+    if (MENUS_PRICE.hasOwnProperty(MENU_NAME))
+      totalPrice += MENUS_PRICE[MENU_NAME] * QUANTITY;
+  });
+
+  return totalPrice;
+}
+
+export function ChampagnePromotionAvailable() {
+  const TOTAL_PRICE = toTalPriceLogic(christmasInstance.getMenus());
+  if (TOTAL_PRICE >= 120000) {
+    return true;
+  } else return false;
+}
+
+// d-day 할인
+export function receivedD_dayPromotion() {
+  const DATE = christmasInstance.getDate();
+  let minusPrice = 1000;
+  let available = true;
+
+  if (DATE >= 26) {
+    available = false;
+  }
+
+  if (available) {
+    for (let i = 1; i < DATE; i++) {
+      minusPrice += 100;
+    }
+  } else {
+    minusPrice = 0;
+  }
+
+  return minusPrice;
+}
+
+function minusPriceCalculator(
+  menus,
+  date,
+  validDays,
+  targetMenuCategories,
+  discountMultiplier
+) {
+  let minusPrice = 0;
+
+  if (!validDays.includes(date)) {
+    return minusPrice;
+  }
+
+  menus.forEach((menu) => {
+    const { MENU_NAME, QUANTITY } = menuAndQuantity(menu);
+    if (targetMenuCategories.includes(MENU_NAME))
+      minusPrice += discountMultiplier * QUANTITY;
+  });
+
+  return minusPrice;
+}
+
+// WEEKDAY 할인
+export function receivedWeekDayPromotion() {
+  const MENUS = christmasInstance.getMenus();
+  const DATE = christmasInstance.getDate();
+  const DESSERT = [`초코케이크`, `아이스크림`];
+
+  return minusPriceCalculator(MENUS, DATE, WEEKDAY, DESSERT, 2023);
+}
+
+// WEEKEND 할인
+export function receivedWeekendPromotion() {
+  const MENUS = christmasInstance.getMenus();
+  const DATE = christmasInstance.getDate();
+  const MAIN = ["티본스테이크", "바비큐립", "해산물파스타", "크리스마스파스타"];
+
+  return minusPriceCalculator(MENUS, DATE, WEEKEND, MAIN, 2023);
+}
+
+export function receivedSpecialPromotion() {
+  const DATE = christmasInstance.getDate();
+  const MINUS_PRICE = 1000;
+  if (STAR_DAY.includes(DATE)) {
+    return MINUS_PRICE;
+  } else return 0;
+}
+
+// 샴페인 증정 이벤트
+export function receivedChampagnePromotion() {
+  const CHAMPAGNE_AVAILABLE = ChampagnePromotionAvailable();
+  const CHAMPAGNE_PRICE = 25000;
+
+  if (CHAMPAGNE_AVAILABLE) {
+    return CHAMPAGNE_PRICE;
+  } else return 0;
+}
+
+export function receivedTotalBenefitPrice() {
+  const DDAY_AVAILABLE = receivedD_dayPromotion();
+  const WEEKDAY_AVAILABLE = receivedWeekDayPromotion();
+  const WEEKEND_AVAILABLE = receivedWeekendPromotion();
+  const CHAMPAGNE_AVAILABLE = receivedChampagnePromotion();
+  const SPECIAL_AVAILABLE = receivedSpecialPromotion();
+  let resultTotalBenefitPrice;
+
+  const totalBenefitPrice =
+    DDAY_AVAILABLE +
+    WEEKDAY_AVAILABLE +
+    WEEKEND_AVAILABLE +
+    CHAMPAGNE_AVAILABLE +
+    SPECIAL_AVAILABLE;
+
+  if (totalBenefitPrice === 0) return 0;
+  if (totalBenefitPrice > 0) return -totalBenefitPrice;
+}
+
+export function receivedTotalDsicountPrice() {
+  const DDAY_AVAILABLE = receivedD_dayPromotion();
+  const WEEKDAY_AVAILABLE = receivedWeekDayPromotion();
+  const WEEKEND_AVAILABLE = receivedWeekendPromotion();
+  const SPECIAL_AVAILABLE = receivedSpecialPromotion();
+
+  const TOTAL_DISCOUNTPRICE =
+    DDAY_AVAILABLE + WEEKDAY_AVAILABLE + WEEKEND_AVAILABLE + SPECIAL_AVAILABLE;
+
+  return TOTAL_DISCOUNTPRICE;
+}
+
+export function totalPriceAfterDiscount() {
+  const TOTAL_DISCOUNTPRICE = receivedTotalDsicountPrice();
+  const TOTAL_PRICE = toTalPriceLogic();
+
+  const TOTAL_AFTER = TOTAL_PRICE - TOTAL_DISCOUNTPRICE;
+
+  return TOTAL_AFTER;
+}
+
+export function sendBadge() {
+  const TOTAL_AFTER = -receivedTotalBenefitPrice();
+  if (TOTAL_AFTER >= 20000) {
+    return "산타";
+  } else if (TOTAL_AFTER >= 10000) {
+    return "트리";
+  } else if (TOTAL_AFTER >= 5000) {
+    return "별";
+  } else {
+    return "없음";
+  }
+}

리뷰: 입력한 날짜만큼 100원씩 추가로 마이너스 가격을 합산하여 최종 합산 할인금액을 계산처리하고 있습니다. 

for문을 사용하지 않고도 입력 날짜를 이용해서 수식으로 해당 일자의 적용할인 금액을 계산할 수 있습니다. 고민해보시고 수식을 활용해 보시면 좋을 거 같아요 (간단히 수식들은 알고 있으면 생각보다 코드작성을 수월하게 도와줍니다)

그리고 가급적 for문을 안쓰고 해결해보려고 해보세요. 저는 이 방식으로 코드를 만들다보니 새로운 방법들을 자꾸 찾게되고 그 속에서 배우는 것들이 정말 많더라고요