Skip to content

Seoljingni/healthy-refrigerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

💪 Healthy Refrigerator

Algorithm Term Project Team 9

✅ Contents

  1. Overview
  2. Problem Story
  3. Problem Statement
  4. I/O Format

👀 Overview

Project Name
Healthy Refrigerator

Team Member

🧑🏻‍💻곽태일 🧑🏻‍💻김건 👩🏻‍💻설지은 🧑🏻‍💻한수민 🧑🏻‍💻허지행
201935007 202234859 202234901 202234944 202234948

@dade1011

@lc__lc1m

@Seoljingni

@Ruila

@HIT-haeng

Project Duration
2023.11.10~2023.12.04

Project Language
Java

📝 Problem Story

Y, a current student at Gachon University living in Bokjeong-dong, found it inconvenient to daily plan meals and check expiration dates.
To address this, Y invested in an artificial intelligence refrigerator.

Users have the option to input, in sequential order, the types of nutrients for which they want to prioritize the application of weights each day.

This refrigerator is equipped with a feature that suggests a diet for each meal, maximizing the intake of desired nutrients while minimizing calorie consumption relative to the capacity of food that can be taken out at once from the user's refrigerator.

Implement an algorithm for the AI in this refrigerator to minimize the disposal of expired food in Y's refrigerator as much as possible.

✔️ Problem Statement

  • Input is received in file format.

  • The total capacity of the refrigerator is limited to 1000.

    • The amount of food added cannot exceed the total capacity and may not fill the refrigerator to its maximum capacity.
  • The user always consumes 100 units of food daily.

    • When entering the initial input, the total amount of food with an expiration period of 2 days or less cannot exceed 100.
    • Foods with an expiration period of 1 day are prioritized for consumption.
      • If the total amount of food with an expiration period of 1 day exceeds 100, items with lower weights are discarded first.
  • Weight Calculation Method

    • Calculate the weight of calories per unit of food capacity & daily input of weight rankings for each food element.
    • Calories/capacity (rounded to two decimal places)
    • 1st priority element X 1.0 + 2nd priority element X 0.7 + 3rd priority element X 0.4
    • (Weight Calculation for Macronutrients) - (Calories per unit of capacity * 10)
  • If the remaining food is less than the maximum capacity that can be taken out, consume all remaining food, output the result, and terminate the program.

🔠 I/O Format

Input

  • Received input in file format
  • Input file format

Food Name, Weight, Expiration Date, Calories, Carbohydrates Content, Protein Content, Fat Content

  • Every day, prioritize the intake of carbohydrates, protein, and fat content.

Output

  • Print the name of the consumed food and the total calories consumed for each day.
  • Output a list of the remaining food names in the refrigerator for each day.

Example

//Input file
chicken breast, 30, 10, 160, 0, 75, 25
buritto, 50, 3, 350, 60, 30, 10
yogurt, 80, 4, 100, 20, 50, 30
meetball spagetti, 100, 5, 480, 65, 25, 10
bread, 40, 2, 300, 80, 10, 10
egg, 18, 7, 25, 10, 65, 25
Kimchi Fried Rice, 150, 2, 650, 88, 7, 5 
pork cutlet, 50, 15, 425, 15, 65, 20
pizza, 110, 5, 510, 60, 5, 35
tteokbokki, 150, 11, 550, 75, 2, 23
//Day by day input
1 2 3
2 3 1
3 2 1
1 3 2
2 1 3
3 1 2
//Expected output
Day: 1
yogurt, egg, tteokbokki
Total calories: 132.34
Leftovers: chicken breast, buritto, meetball spagetti, bread, pork cutlet, pizza, tteokbokki

Day: 2
bread, chicken breast, tteokbokki
Total calories: 570.1
Leftovers: buritto, meetball spagetti, pork cutlet, pizza, tteokbokki

Day: 3
buritto, tteokbokki
Total calories: 533.5
Leftovers: meetball spagetti, pork cutlet, pizza, tteokbokki

Day: 4
tteokbokki, pizza
Total calories: 397.54
Leftovers: meetball spagetti, pork cutlet, pizza

Day: 5
meetball spagetti
Total calories: 480
Leftovers: pork cutlet

Day: 6
pork cutlet
Total calories: 425
Leftovers: none

exit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages