In this C++ program, you will create an object and display it. Create a class nerfGun that
Question:
In this C++ program, you will create an object and display it. Create a class nerfGun that includes data members model (string), range(int), capacity (int), and number of darts (int). Your class should have a constructor with three parameters (assume the toy is fully loaded when created). Assume that model and range is correct, but check to make sure capacity is <= 144. Provide a member function getModel(), getCapacity(), getDartCount(), fire() and reload(quantity). The method fire() reduces the number of darts.The method reload(quantity) should increase the number of darts by the quantity provided but must ensure the number of darts do not exceed the toy’s capacity .
Write a program that creates, fires, and reloads two different nerf guns. Run your program with at least three different sets of data.
Statistics The Art and Science of Learning from Data
ISBN: 978-0321755940
3rd edition
Authors: Alan Agresti, Christine A. Franklin