public void evaluateMarkPer(MarketingTeam mt, MarketingTeam mt1) { if (mt.busVolume > mt1.getTarget()) { mPercent = 100; } else { double dNum = mt.busVolume / mt1.getTarget(); mPercent = Convert.ToInt32(dNum * 100); } Console.WriteLine("The employee {0} of Marketing Team is {1}", mt.Name, mt.evaluateGrade(mPercent)); }
public static void Main() { MainClass mc = new MainClass(); TechnicalTeam techManager = new TechnicalTeam(); MarketingTeam marketManager = new MarketingTeam(); //Technical Manager sets the target techManager.setTarget(3000); //Marketing Manager sets the target marketManager.setTarget(50); login: Console.WriteLine("******************************LOGIN PORTAL***********************************"); Console.WriteLine("Enter the name : "); String name = Console.ReadLine(); Console.WriteLine("Enter the password : "******"Enter the details of the Technical Employee to Review"); Console.Write("Enter the name :"); Console.WriteLine(); tt.Name = Console.ReadLine(); Console.Write("Enter the GID :"); tt.GID = Int32.Parse(Console.ReadLine()); for (int iCounter = 0; iCounter < 3; iCounter++) { Console.WriteLine("Enter the performance details of the Technical Employee to Review"); Console.WriteLine(); Console.Write("Enter the Bill Amount : "); tt.billAmt = Int32.Parse(Console.ReadLine()); Console.WriteLine(); tech: Console.WriteLine("Enter the number of technology upgrages :"); tt.techNum = Int32.Parse(Console.ReadLine()); if (tt.techNum > 3) { Console.WriteLine("Cannot have upgrades more than 3"); goto tech; } cert: Console.WriteLine("Enter the number of certificates : "); tt.certNum = Int32.Parse(Console.ReadLine()); if (tt.certNum > 1) { Console.WriteLine("Cannot have certtificates more than 1"); goto cert; } Console.WriteLine(); mc.evaluateTechPer(tt, techManager); } Console.WriteLine("Enter the details of the Marketing Employee to Review"); Console.Write("Enter the name : "); mt.Name = Console.ReadLine(); Console.WriteLine(); Console.Write("Enter the GID : "); mt.GID = Int32.Parse(Console.ReadLine()); for (int iCounter = 0; iCounter < 3; iCounter++) { Console.WriteLine("Enter the performance details of the Marketing Employee to Review"); Console.WriteLine(); Console.WriteLine("Enter the Business Volume : "); mt.busVolume = Int32.Parse(Console.ReadLine()); Console.WriteLine(); mc.evaluateMarkPer(mt, marketManager); } Console.WriteLine("Technical Team : The Average of the {0} for 3 Months is {1}", tt.Name, totalTPer / 3); Console.WriteLine("Marketing Team : The Average of the {0} for 3 Months is {1}", mt.Name, totalMPer / 3); } else { Console.WriteLine("Invalid User..!!"); goto login; } }