Answered You can hire a professional tutor to get the answer.

QUESTION

Hello! there already is a preexisting solution to this project but it lacks the .h files.

Hello! I need help with this... there already is a preexisting solution to this project but it lacks the .h files.

Chapter 14

You should know inheritance from Java but to get a chance to use C++ syntax, make a base class gun. Gun should have

        string manufacturer;

         caliber;

handgun should inherit from gun and add

     string grips;

     string sights;

      laser;

Each class must have its own .cpp and .h file.

Finally have classes revolver and pistol that inherit from handgun. Revolver should add:

            singleAction;

                numberOfRounds;

Pistol should have:

            semiauto;

Make good decisions about constructors, private variables, mutators and accessors.

Make an appropriate test program by instantiating and printing at least one revolver and one pistol.

Example Output:

Revolver: Smith & Wesson, 0.357, 6 shot, double action, hoague grips, laser, Trijicon

Pistol: Glock, 9mm, semi-auto, manufacturers grips, no laser, 3 dot sights

Chapter 15

Add a virtual print function to your base class gun in your chapter 15 homework.

Make an array gunCabinet that contains revolvers and pistols and prints out its contents using the following loop:

for(i=0; i < numGuns; i++)

  gunCabinet[i]->print();

Example Output:

My Gun Cabinet Contains:

Revolver: Smith & Wesson, 0.357, 6 shot, double action, hoague grips, laser, Trijicon

Pistol: Glock, .40, semi-auto, synthetic grips, no laser, 3 dot sights

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question