Question: Help with the below task, console application in C# language. (A Simplistic Bicycle Class) The task is to write a class Bicycle, according to the
Help with the below task, console application in C# language.
(A Simplistic Bicycle Class) The task is to write a class Bicycle, according to the following description:
Suppose you want to create a number of Bicycle objects of that class and assign each of them, a serial number (Id), beginning with 1001 for the first object.
Description of the class:
Your class holds pieces of information including Id, speed of the Bicycle (an integer) and model (can be a string).
The value of the instance variable, speed will be initialized to zero in the constructor of your class. Initiate the value of model to your favourite model.
Provide a property to read and modify the speed.
Provide a read-only property to only read the model (no set block).
Provide two methods, Accelerate and Brake. The Accelerate method adds 5 to speed and the Brake method subtract 5 from the speed. (If the speed is zero, the brake method shall not affect the speed).
Test your class in an application. (As explained in task 1e, create some objects of your class, call different methods, and print all the information (including Id-number) on the console window, or simply provide a menu for user to choose between different options (menu is not a requirement!)).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
