Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ Improve on the Bike class. The Bike class must contain 2 private attributes: An int called gearCount and a double named distanceTravelled. You must
c++
File is marked as read only Current file: main.cpp 1 #include "Bike.h" 2 #includeImprove on the Bike class. The Bike class must contain 2 private attributes: An int called gearCount and a double named distanceTravelled. You must edit the Bike.h and Bike.cpp files to add the class definition and method implementation.
The class must now include code that will get the values of the 2 private attributes. Further, you must include 2 constructors, a default and a 2-arg constructor. The default constructor must assign gearCount to 1 and distanceTravelled to 1.5. The 2-arg constructor must accept gearCount and distanceTravelled in that order, and assign the attributes.
main.cpp file must work as written.
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