Question: Convert a structure into a class implementation. Details: . Start with the repl code provided to you Modify all of the functions so that they



Convert a structure into a class implementation. Details: . Start with the repl code provided to you Modify all of the functions so that they are member functions. Use the scope resolution operator (:) to show that an implementation of a function is part of a class Change the initialization function into a constructor with arguments. Add a default constructor that initializes things to 0 or empty string. Please note that you should use a for loop to initialize all the values of furColours Add one getter to return the furclassification . Modify the calls in main to reflect the change in the functions. Be sure to add the keyword const after functions that do not change the data . If you want, you can turn the istaller function into an overloaded operator> Here are two sample runs that you can try in the lab: hercules [5] 1 ./main Please describe the cat Please enter a length: 48 Please enter a height: 25 Please enter a tail length: 31 Please enter an eye colour blue Please enter a description of the Eur (long, medium, short, none): short Please enter the colours of the fur (separated by space or a newline character). Add done" at the endi grey white done The average cat has medium fur This is myCat Length: 48 Height: 25 Tail Length: 31 Hye Colour: blue Pur. Classification short cat Colours grey white My cat is taller than the average cat hercules [6] hercules/611 ./main Please describe the cat Please enter a length: 44 Please enter a height: 22 Please enter a tail length: 30 Please enter an eye colour: yellow Please enter a description of the fur (long, medium, short, none): long Please enter the colours of the fur (separated by a space or a newline Jeharacter). Add done" at the end: black white orange done The average cat has medium fur This is myCat: Length: 44 Height: 22 Tail Length: 30 Eye Colour: yellow Fur Classification: long Cat Colours: black white orange My cat is shorter than the average cat My cat is a calico // Filename: main.cpp // Purpose: To convert a structure into a class implementation. #include "Cat.h" #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
