public int Calculate(InsuranceInfo info) { int basePrice = CalcualateBasePrice(cfg.BasePrices, info.CarDetails.HorsePower); int percent = 100; if (info.InsuranceDetails.WithLimitations) { if (info.PersonalDetails.Age < 21) { percent += cfg.AgePercent; } if (info.PersonalDetails.Experience < 3) { percent += cfg.ExperiencePercent; } } else { percent += cfg.WithoutLimitationsPercent; } if (service.WasWithoutCrashes(info)) { percent -= cfg.WithoutCrashesPercent; } return((int)Math.Ceiling(percent * basePrice / 100.0)); }
public void Start(InsuranceInfo info) { this.info = info; form = new TForm(); ConfigureForm(form); Application.Run(form); }
public void Reset() { info = new InsuranceInfo(); MoveOn(firstScreenType); }