Implement class Handgun - a handgun is being created with a full clip of maxAmmo ammunition. It can .shot() and .reload(n). In order to shot it should has ammo. Shooting reduces ammo in the clip. Reloading fills ammo by n. You can't reload more ammo then a handgun's clip may have. Use imagination.
Implement class
Handgun
- a handgun is being created with a full clip ofmaxAmmo
ammunition. It can.shot()
and.reload(n)
. In order to shot it should has ammo. Shooting reduces ammo in the clip. Reloading fills ammo byn
. You can't reload more ammo then a handgun's clip may have. Use imagination.