using System.Collections.Generic;
public static void Main()
Console.WriteLine("This is part 4");
Chicken chicken1 = new Chicken();
Paneer paneer2 = new Paneer();
Lentils lentils4 = new Lentils();
ProteinShake ps5 = new ProteinShake();
for (int i = 0; i < diet.Length; i++)
MealPrep mealPrep = new MealPrep();
Console.WriteLine("---------------------------");
Console.WriteLine("Choose what you want to add to your meal prep");
Console.WriteLine("1: Chicken");
Console.WriteLine("2: Milk");
Console.WriteLine("3: Protein Shake");
Console.WriteLine("4: Paneer");
Console.WriteLine("5: Lentils");
Console.WriteLine("6: Exit");
string choice = Console.ReadLine();
Console.WriteLine("What is the quantity of this item you want to add?");
string quant = Console.ReadLine();
bool success = int.TryParse(quant, out int num);
Chicken chicken = new Chicken();
mealPrep.AddToMealPlan(chicken);
mealPrep.AddProteinAndCalories();
mealPrep.AddToMealPlan(milk);
mealPrep.AddProteinAndCalories();
ProteinShake ps = new ProteinShake();
mealPrep.AddToMealPlan(ps);
mealPrep.AddProteinAndCalories();
Paneer paneer = new Paneer();
mealPrep.AddToMealPlan(paneer);
mealPrep.AddProteinAndCalories();
Lentils lentils = new Lentils();
mealPrep.AddToMealPlan(lentils);
mealPrep.AddProteinAndCalories();
Console.WriteLine("You are exiting");
List<Protein> list = new List<Protein>();
public void AddToMealPlan(Protein protein)
public void AddProteinAndCalories()
foreach (Protein p in list)
TotalProtein += p.GramsProtein * p.Count;
TotalCalories += p.Calories * p.Count;
Console.WriteLine(TotalProtein);
Console.WriteLine("The total protein in the Meal plan is: " + TotalProtein + " grams");
Console.WriteLine("The total calories in the Meal plan are: " + TotalCalories);
public int TotalProtein { get; set; }
public int TotalCalories { get; set; }
public abstract class Protein
public abstract void getGains();
public abstract void getEnergy();
public int GramsProtein { get; set; }
public int Count { get; set; }
public int Calories { get; set; }
internal class Chicken : Protein
public override void getGains()
Console.WriteLine("Protein from Chicken: " + GramsProtein + " grams");
public override void getEnergy()
Console.WriteLine("Calories from Chicken: " + Calories);
internal class Milk : Protein
public override void getGains()
Console.WriteLine("Protein from Milk: " + GramsProtein + " grams");
public override void getEnergy()
Console.WriteLine("Calories from Milk: " + Calories);
internal class ProteinShake : Protein
public override void getGains()
Console.WriteLine("Protein from ProteinShakes: " + GramsProtein + " grams");
public override void getEnergy()
Console.WriteLine("Calories from ProteinShakes: " + Calories);
internal class Paneer : Protein
public override void getGains()
Console.WriteLine("Protein from Paneer: " + GramsProtein + " grams");
public override void getEnergy()
Console.WriteLine("Calories from Paneer: " + Calories);
internal class Lentils : Protein
public override void getGains()
Console.WriteLine("Protein from Lentils: " + GramsProtein + " grams");
public override void getEnergy()
Console.WriteLine("Calories from Lentils: " + Calories);