static void TodaySummary() { if (prodCount >= prodGoal) { Console.WriteLine("Production Goal is achieved"); Console.WriteLine("Remaining inputs\n" + input1.GetName() + ": " + input1.GetAmount() + "\n" + input2.GetName() + ": " + input2.GetAmount()); } else if (prodCount < prodGoal) { string reason = ""; Console.WriteLine("Production Goal is not achieved"); if ((input1.GetAmount() == 0 && input2.GetAmount() <= 1) || (input1.GetAmount() == 0 && input2.GetAmount() / 2 * 4 + prodCount < prodGoal) || (input1.GetAmount() * 4 + prodCount < prodGoal && input2.GetAmount() <= 1)) { Console.WriteLine("Remaining inputs\n" + input1.GetName() + ": " + input1.GetAmount() + "\n" + input2.GetName() + ": " + input2.GetAmount()); reason = "insufficient amount of " + input1.GetName() + " and " + input2.GetName(); } else if (input1.GetAmount() == 0) { Console.WriteLine("Remaining inputs\n" + input1.GetName() + ": " + input1.GetAmount() + "\n" + input2.GetName() + ": " + input2.GetAmount()); reason = "insufficient amount of " + input1.GetName(); } else if (input2.GetAmount() <= 1) { Console.WriteLine("Remaining inputs\n" + input1.GetName() + ": " + input1.GetAmount() + "\n" + input2.GetName() + ": " + input2.GetAmount()); reason = "insufficient amount of " + input2.GetName(); } Console.WriteLine(reason); } ProductConditionCheck(); }
static void Main(string[] args) { Console.WriteLine("Product Manufacturing Tracking System"); Console.Write("Set today's production goal: "); prodGoal = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Product: " + product.GetName()); Console.Write("Enter amount of sugar in Kilos: "); input1 = new RawInput("Sugar", Convert.ToInt32(Console.ReadLine())); Console.Write("Enter amount of Ginger in Kilos: "); input2 = new RawInput("Ginger", Convert.ToInt32(Console.ReadLine())); Console.WriteLine("\nAvailable inputs\n" + input1.GetName() + ": " + input1.GetAmount() + "\n" + input2.GetName() + ": " + input2.GetAmount()); Processing(input1, input2); Console.WriteLine("Amount of products produced: " + prodCount + " " + product.GetUnit()); Console.WriteLine("-----------------Today's Production Summary----------------------"); TodaySummary(); }