Question: Task 1: Classes and fields Create the following classes (written in italics) and fields / private data members (enclosed in double quotes): Each Gun has
Task 1: Classes and fields Create the following classes (written in italics) and "fields" / "private data members" (enclosed in double quotes): Each Gun has a "position", "power" and "points", all integers. Each gun also has a "justFired" status which can be either true or false (i.e. of type boolean; see the free textbook online by Parsons, sectio 3.1.3, "Boolean Variables", page 33, or google java tutorial boolean). . The PlayerShip has "position", an integer, and two instances of Gun, called "gunl" and "gun2" Each EnemyShip has "position", "velocity" and "life", all integers. Each enemy ship also has a "justHit" status which can be either true or false (i.e. of type boolean see the free online textbook by Parsons, section 3.1.3, "Boolean Variables", page 33). The class EnemyShip also maintains a count of the number of enemy ships that have been created so far, called "number", an integer, which is not attached to any one particular enemy ship, but rather is associated with the whole class of enemy ships. Thus "number" in EnemyShip has a similar role to "numSummersn SummerOO .A Game has 1 PlayerShip called "player", and 3 instances of EnemyShip called "enemyl" "enemy2" and "enemy3" In the above bullet point descriptions, note that the names of the classes and fields follow Java's naming conventions. That is, class names begin with an uppercase letter, field names begin with a lowercase letter, compound nouns are joined without a space and the second word begins with an uppercase letter). Note: all fields should be declared as private. When you have completed this entire task, submit your code to PLATE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
