Answered step by step
Verified Expert Solution
Link Copied!

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++
Improve 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.
image text in transcribed
image text in transcribed
image text in transcribed
File is marked as read only Current file: main.cpp 1 #include "Bike.h" 2 #include 3 #include 4 using namespace std; 5 6 7 8 /*** Do NOT change this file **/ 9 int main() 10 { 11 12 13 //This code must work as written 14 Bike firstBike; 15 Bike b(24, 580.278); 16 17 cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions