private void ChooseBestOffer(ISearchResult amazonOffer, ISearchResult apressOffer) { if (amazonOffer == null && apressOffer == null) { Console.WriteLine("Sorry. Could not find best offer for you. Please try with another book title."); return; } Console.WriteLine("Best offer for you:"); if (amazonOffer == null) { Console.WriteLine(apressOffer.ToString()); return; } if (apressOffer == null) { Console.WriteLine(amazonOffer.ToString()); return; } if (amazonOffer.BookPrice > apressOffer.BookPrice) { Console.WriteLine(apressOffer.ToString()); return; } if (amazonOffer.BookPrice < apressOffer.BookPrice) { Console.WriteLine(amazonOffer.ToString()); return; } Console.WriteLine("Two same price offers found:"); Console.WriteLine(apressOffer.ToString()); Console.WriteLine(amazonOffer.ToString()); }