Question: Define a class called Bicycle that has two private data members (the wheel size and number of gears, both are int ) and two member

Define a class called Bicycle that has two private data members (the wheel size and number of gears, both are int) and two member functions (a constructor and a print function). You need to define your own constructor with the function prototype Bicycle(int, int); In the function body of the constructor, you need to verify whether the value of the wheel size is between 15 to 35, the number of the gears is between 5 to 20. Otherwise, set the wheel size to 20 and the number of gears to 12. In your print() function, output the data as follows:

Bicycle Information:

Wheel size: XX

Number of gears: XX

where XXs are some integers. In your main program, define an object with some data and call the function print().

C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!