Menu

[Solved]Write Class Definition Component Class H File Two Public String Fields Named Manufacturer Q37233695

Write a class definition of theComponent class (in .h file), which has two public string fieldsnamed manufacturer andproduct_name and an initializing constructor. Givean implementation of the constructor as it would appear in the .cppfile.

.h

.cpp

(b)   Write a classdefinition of the Wheel class, which inherits all fields from theComponent class and adds a public floating point field nameddiameter. It has an initializing constructor thatinitializes all fields. Give an implementation of the constructoras it would appear in the .cpp file; it should make use of otherinitializing constructors where possible.

.h

.cpp

(c)    Write aclass definition of the Seat class, which inherits all fields fromthe Component class and adds a string field namedcolour that is available outside the class. It hasan initializing constructor that initializes all fields. Give animplementation of the constructor as it would appear in the .cppfile; it should make use of other initializing constructors wherepossible.

.h

.cpp

(d)   Write a classdefinition for the Bicycle class that contains three encapsulatedvariables, one for the front wheel, one for theback wheel, and one for the bicycleseat. Provide an initializing constructor thattakes 9 parameters (three for the front wheel, three for the backwheel, and three for the seat). Give an implementation of theconstructor as it would appear in the .cpp file; it should make useof other initializing constructors where possible.

.h

.cpp

(e)    Imagineadding a print function to the Bicycle class. List the fieldsavailable for printing with cout from the Bicycle class.

Expert Answer


Answer to Write a class definition of the Component class (in .h file), which has two public string fields named manufacturer and… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *