static void Main(string[] args) { ICalculator sciCalc = new ScientificCalculator(); double sciCalcResult = sciCalc.Add(2, 5); Console.WriteLine($"Scientific Calculator 2 + 5: {sciCalcResult}"); ICalculator prgCalc = new ProgrammerCalculator(); double prgCalcResult = prgCalc.Add(5, 10); Console.WriteLine($"Programmer Calculator 5 + 10: {prgCalcResult}"); Console.ReadKey(); }
public static void Main() { ScientificCalculator sciCalc = new ScientificCalculator(); double powerResult = sciCalc.Power(2, 5); Console.WriteLine($"Scientific Calculator 2**5: {powerResult}"); double sciSum = sciCalc.Add(3, 3); Console.WriteLine($"Scientific Calculator 3 + 3: {sciSum}"); ProgrammerCalculator prgCalc = new ProgrammerCalculator(); double orResult = prgCalc.Or(5, 10); Console.WriteLine($"Programmer Calculator 5 | 10: {orResult}"); double prgSum = prgCalc.Add(3, 3); Console.WriteLine($"Programmer Calculator 3 + 3: {prgSum}"); Console.ReadKey(); }
public static void Main() { ScientificCalculator sciCalc = new ScientificCalculator(); double powerResult = sciCalc.Power(2, 5); Console.WriteLine($"Scientific Calculator 2**5: {powerResult}"); double sciSum = sciCalc.Add(3, 3); Console.WriteLine($"Scientific Calculator 3 + 3: {sciSum}"); ProgrammerCalculator prgCalc = new ProgrammerCalculator(); double orResult = prgCalc.Or(5, 10); Console.WriteLine($"Programmer Calculator 5 | 10: {orResult}"); double prgSum = prgCalc.Add(3, 3); Console.WriteLine($"Programmer Calculator 3 + 3: {prgSum}"); Console.ReadKey(); }
public void AddTest() { Assert.AreEqual(7, calc.Add(3, 4)); }
public static void xMain() { AdminLogin login = new AdminLogin(); login.LoginFromEmailCode(); login.LoginFromSMSCode(); login.LoginByIdPassword(); Console.WriteLine("***************************************"); Vitz1999Standard vitz99 = new Vitz1999Standard(); Console.WriteLine(vitz99.model); Console.WriteLine(vitz99.price); Console.WriteLine(vitz99.dimensions); vitz99.Start(); vitz99.AirConditioning(); vitz99.Transmission(); vitz99.Braking(); Console.WriteLine("***************************************"); Vitz2004Auto vitz04 = new Vitz2004Auto(); Console.WriteLine(vitz04.model); Console.WriteLine(vitz04.price); Console.WriteLine(vitz04.dimensions); vitz04.Start(); vitz04.AirConditioning(); vitz04.Transmission(); vitz04.Braking(); Console.WriteLine("********************************"); Vitz2005 vitz05 = new Vitz2005(); Console.WriteLine(vitz05.model); Console.WriteLine(vitz05.price); Console.WriteLine(vitz05.dimensions); vitz05.Start(); vitz05.AirConditioning(); vitz05.Transmission(); vitz05.Braking(); Console.WriteLine("********************************"); NaseemSahab naseem = new NaseemSahab(); naseem.FavouriteWork(); Console.WriteLine("********************************"); Farasat1 farast = new Farasat1(); farast.FavouriteWork(); Calculator cal = new Calculator(); cal.Add(1, 2); cal.Add(1, 2.5); cal.Add(3.5, 2); cal.Add(1, 2, 3); ScientificCalculator scCal = new ScientificCalculator(); scCal.Add(1, 2); scCal.Add(1, 2.5); scCal.Add(3.5, 2); scCal.Add(1, 2, 3); scCal.Add(1, 2, 3.3); // Overloaded version in the child class Console.WriteLine("********************************"); IPhone5S iphone5s = new IPhone5S(); iphone5s.Calling(); iphone5s.InternetSurfing(); iphone5s.Gaming(); Console.ReadLine(); SingleSignOn singleSignOn = new SingleSignOn(); singleSignOn.fbSignOn.SignIn(); singleSignOn.instaSignOn.SignIn(); singleSignOn.googleSignOn.SignIn(); SofaCumBed sofaCumBed = new SofaCumBed(); sofaCumBed.bed.Lay(); sofaCumBed.sofa.Lay(); }
static void Main(string[] args) { // Using Inheritance Console.WriteLine("GAG CALCULATOR"); GagCalculator gc = new GagCalculator(); Console.WriteLine("Entering 5"); gc.EnterNumber(5); Console.WriteLine($"The current value is: {gc.Result}"); Console.WriteLine("Adding 12"); gc.Add(12); Console.WriteLine($"The current value is: {gc.Result}"); Console.WriteLine(gc); //WHAT DOES THIS PRINT?? Console.WriteLine(); Calculator basicCalc = new Calculator(); Console.WriteLine($"The current value is: {basicCalc.Result}"); Console.WriteLine("Entering 5"); basicCalc.EnterNumber(5); Console.WriteLine($"The current value is: {basicCalc.Result}"); Console.WriteLine("Adding 12"); basicCalc.Add(12); Console.WriteLine($"The current value is: {basicCalc.Result}"); Console.WriteLine(); Console.WriteLine("PROGRAMMER CALC"); ProgrammingCalculator programmerCalc = new ProgrammingCalculator(); Console.WriteLine($"The current value is: {programmerCalc.Result}"); Console.WriteLine("Entering 5"); programmerCalc.EnterNumber(5); Console.WriteLine($"The current value is: {programmerCalc.Result}"); Console.WriteLine("Adding 12"); programmerCalc.Add(12); Console.WriteLine($"The current value is: {programmerCalc.Result}"); Console.Write("Showing as binary "); Console.WriteLine(programmerCalc.ToBinary()); Console.WriteLine(); Console.WriteLine("SCIENTIFIC CALC"); ScientificCalculator science = new ScientificCalculator(); Console.WriteLine($"The current value is: {science.Result}"); Console.WriteLine("Entering 5"); science.EnterNumber(5); Console.WriteLine($"The current value is: {science.Result}"); Console.WriteLine("Adding 12"); science.Add(12); Console.WriteLine($"The current value is: {science.Result}"); // AUCTIONS // Create a new general auction //Console.WriteLine("Starting a general auction"); //Console.WriteLine("-----------------"); //Auction generalAuction = new Auction(); //generalAuction.PlaceBid(new Bid("Josh", 1)); //generalAuction.PlaceBid(new Bid("Fonz", 23)); //generalAuction.PlaceBid(new Bid("Rick Astley", 13)); //.... //.... // This might go on until the auction runs out of time or hits a max # of bids //// The rules of a buyout auction automatically end //// when the buyout price is met //Console.WriteLine(); //Console.WriteLine("--------------"); //Console.WriteLine("Buyout Auction"); //Console.WriteLine(); //Console.WriteLine(); //BuyoutAuction buyoutAuction = new BuyoutAuction(55); //buyoutAuction.PlaceBid(new Bid("Rick Astley", 20)); //buyoutAuction.PlaceBid(new Bid("Michael Scott", 30)); //buyoutAuction.PlaceBid(new Bid("Dwight Schrute", 20)); //buyoutAuction.PlaceBid(new Bid("Ryan Howard", 56)); //Console.WriteLine(); //Console.WriteLine("--------------"); //Console.WriteLine("Reserve Auction"); //Console.WriteLine(); //Console.WriteLine(); //ReserveAuction reserveAuction = new ReserveAuction(80); //reserveAuction.PlaceBid(new Bid("Ted Mosby", 35)); //reserveAuction.PlaceBid(new Bid("Marshall Erickson", 55)); //reserveAuction.PlaceBid(new Bid("Barney Stinson", 80)); //reserveAuction.PlaceBid(new Bid("Lily Erickson", 60)); //reserveAuction.PlaceBid(new Bid("Robin Sherbatsky", 85)); //.... //.... // This might go on until the auction runs out of time or hits a max # of bids }
public void AddTest() { double result = _calculator.Add(_value1, _value2); Assert.Equal(result, 12.0); }
public double Add_TestCases(double x, double y) { return(scientificCalculator.Add(x, y)); }