Create a base class named car the car class is to have the


Create A Code

Create a base class named Car. The Car class is to have the properties AdjustFactor (double) and InitSpeed (double). There is one overridable method named DeltaSpeed that returns a double; this method computes AdjustFactor * InitSpeed and returns this value. Using a constructor set the default value of AdjustFactor to 0.15. Create a derived class named SportCar that inherits from Car. Override DeltaSpeed and change the computation to AdjustFactor * InitSpeed + 10. Using a constructor set the default value of AdjustFactor to 0.30. Applying the principle of polymorphism: Declare a variable named vehicle [hint; make this a class variable of type Car]. If the radEconomy is selected then make a Car instance of vehicle, otherwise make a SportCar instance of vehicle [hint; think about where you need to perform your instantiations in one button handler or two button handlers]. When a user enters a beginning speed into txtBeginSpeed assign that to the initSpeed property. Check to be certain that the user is entering a numeric value in the text box, if it is not numeric display a message box stating Enter numeric values only, entitle this message box as Input Error. Use the DeltaSpeed method to compute changes in speed, display the resulting speed in txtSpeed. Take some time before you write any code to think about what you need to accomplish and the best way to accomplish it. Carefully consider issues such as scope of variables and use of accumulator variables (these considerations are of importance when working with multiple event handlers or event handlers that can be used multiple times).

Request for Solution File

Ask an Expert for Answer!!
Other Subject: Create a base class named car the car class is to have the
Reference No:- TGS0613284

Expected delivery within 24 Hours