Assignment Task:
Task:
Your task is to simulate spaceships combat. The Romulan Empire and the United Federation of Planets are at war. All ships have shields and hull integrity which are both initially equal to 100. Any damage to the ship is first deducted from the strength of the shields, and when it falls to 0, it takes away from the integrity of the hull. The ship is destroyed when its hull integrity drops to 0.
All ships are equipped with lasers. In particular,Romulan ships are additionally equipped with plasma torpedo and cloaking device. Federation ships are additionally equipped
photon torpedo.
Base class Vessel
- Create a basic abstract class Vessel that will contain the following:
- Variable Shields type int -shield strength.
- Variable Hull type int -hull integrity.
- Variable Cloaked type bool that tells if a given ship is currently hidden.
- Variable LaserPower type int that contains the current laserpower.
- A constructor that receives nothing and sets the power of the shields and the integrity of the hull to 100,the power of the laser at 0 and indicates that the ship is not hidden.
- A virtual destructor that does nothing.
- Pure virtual function virtual void Charge()=0; which performs the loading of weapons systems of ship.
- The function: void FireLaserAt(Vessel&Target),which indicates that the calling ship is firing a laser at ship:Target.
- If the calling ship is hidden,the command is ignored and nothing happens.
- When any ship calls this function, it damages the amount of LaserPower on the Target,and laserstrenght of the firing ship falls to 0. Exceptionally,if the firing ship was hidden,no damage is applied to it,but the laserpower of the laser still drops to 0.
Derived class FederationVessel
- Create a class FederationVessel that inherits from the class Vessel class that will contain the following:
- Variable PhotonPower type int -power of photon torpedoes.
- Static variable NoAllies type int which contains dana: how many federation ships participate in combat(including destroyed).
- A constructor that, in addition to what the base class constructor does,sets the initial power of photon torpedoes at 0.
- Function void FirePhotonAt(Vessel&Target) which indicates that the federation ship caller is firint a photon torpedo on the ship Target.
- If the photon torpedo power of the ship that called that function is less than 5 or the ship caller is hidden, the command is ignored and nothing happens.
- Otherwise, when any federation ship calls for this function, it will damage the amount of 2*PhotonPower on the ship Target, and the power of the photon torpedo of firing ship drops to 0.
- Exceptionally, if the ship being shot at was hidden, no damage is done to it, but the power of the photon torpedo shot still drops at 0.
- Function void Charge()that implements a basic virtual function that increases laser power and photon torpedoes for 1. If the caller ship is hidden, the command is ignored and nothing happens.
Derived class RomulanVessel
- Create class RomulanVessel that inherits from the Vessel class that will contain the following:
- Variable PlasmaPower type int - plasma torpedo power
- Static variable NoAllies type int which contains data on how many Romulan ships participate in fighting (including destroyed)
- Constructor which, in addition to what the base class constructor does, sets the initial power of the plasma torpedo at 0.
- Function void FirePlasmaAt(Vessel&Target) which indicates that the Romulan ship caller is firing plasma torpedo on the ship Target.
- If the plasma torpedo power of the ship that called this function is less than 10 or the ship caller is hidden, the command is ignored and nothing happens. Otherwise, when any Romulan ship calls this function, the damage is 4 * PlasmaPower to ship Target,and plasma power of the ship's torpedoes that fires drops at 0. Exceptionally, if the ship that is being shot on was hidden, no damage was done to it, but the plasma power of the torpedo of shooter still drops to 0.
- Function void Charge()that increases the power of the laser and plasma torpedoes by 1. If the ship caller is hidden, the command is ignored and nothing happens.
- Function void Cloak()that makes the ship hidden. While the ship is hidden, it cannot fire or charge weapons with the Charge() function, in which case these commands must be ignored without any changes.
Function void Uncloak()that makes the ship unhidden.
All methods and variables of all classes should be public. The structure, functions, and files must be named exactly as specified in the task. Watch out for the upper/lowercase letters. No function should read anything from the keyboard or a file, or print anything to the screen, or to a file.
You only need to submit the interface and implementation. Call the interface Vessel.h, and the implementation Vessel.cpp.The check is fully automatic, so it is crucial that you adhere to the specifications. Failure to comply can easily result in winning 0 points from the task!
The above IT Assignment has been solved by our IT Assignment Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert qualit assignment or order an old solution file that was considered worthy of the highest distinction.