Question
Create a new C# program named CarMaker. This program will allow the user to enter year, make and model of a car and if all
Create a new C# program named CarMaker. This program will allow the user to enter year, make and model of a car and if all data passed validation, it creates a car object and allows the user to accelerate and brake the car with buttons. When the user clicks the Accelerate or Brake button, it will display in a label, the make, model, year and current speed of the car. Add a Create A Car button, that will create a car object that can accelerate and brake by 5 mph increments. To create the car object, year must be a valid integer and make and model are required entries. If data passes validation, clear the 3 user input text boxes, then a car is created and the user can begin to accelerate, brake and display current speed of car along with the make model and year properties of the current car object. These 3 properties should be accessed by public property blocks of the classs class-level variables. The Car class constructor should accept Year, Make and Model only. If validation failed, inform user of the missing data and no car object is created. Data validation should be done on the form - in the Create A Car button click event - not in the Car class. Clicking the Accelerate button will increment speed by 5mph. Clicking the Brake button will decrease speed by 5 mph. So the Car class should have a constructor that accepts year, make and model with any necessary public property blocks. The Car class will also have the Brake and Accelerate methods that are called when the user clicks one of the buttons. When a new car is created, make sure the speed is reset to zero. Also take care to make sure a car has actually been created before accelerating or braking or inform the user that they must first create a car. In the Brake method, take care of the possibility of negative mph. If the user clicks the brake button and current speed is zero, the speed should stay at zero. This should be taken care of in the Brake method of the class. The user can create as many different cars as they wish. (Only one car object exists at any time). If they create another car with different values, speed begins at zero. A Show Summary button will display - in a new window - how many cars were created and the maximum clocked speed of all created cars. Display the values in the Activated event of the summary form. Good names, documentation, copy to I drive, etc. Print code and this sheet to submit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started