Question
(IN C++) You should know inheritance from Java but to get a chance to use C++ syntax, make a base class gun. Gun should have
(IN C++) 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; string caliber; handgun should inherit from gun and add string grips; string sights; bool laser; Finally have classes revolver and pistol that inherit from handgun. Revolver should add: bool singleAction; int numberOfRounds; Pistol should have: bool semiauto; Make good decisions about constructors, private variables, mutators and accessors. All classes must be in their own file with a .h file. 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
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