Create a class called Asteroid that has the following attributes: Asteroid goldOre - Double silverOre - Double
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a class called Asteroid that has the following attributes:
Asteroid |
goldOre - Double |
silverOre - Double |
platinumOre - Double |
cubicYards - Double |
Asteroid () |
Asteroid (goldOre, silverOre, platinumOre, cubicYards) |
getGoldOre() - Double |
mineGoldOre(Double) - Boolean |
getSilverOre() - Double |
mineSilverOre(Double) - Boolean |
getPlatinumOre() - Double |
minePlatinumOre(Double) - Boolean |
getCubicYards() - Double |
toString() - String |
Note:
The get methods will return the values in the related attributes
The mine methods will reduce the amount of the corresponding ore remaining, and also reduce the amount of cubic yards.
All mine methods will return false if cubic yards <= 0
THEN create a class:
Create a class called Drill that has the following attributes:
Drill |
efficiency - Double |
durability - Double |
maxDepth - Double |
Drill() |
Drill(efficiency, durability, maxDepth) |
getEfficiency() - Double |
getDurability() - Double |
getMaxDepth() - Double |
mineGold(Asteroid) |
mineSilver(Asteroid) |
minePlatinum(Asteroid) |
toString() - String |
Note:
The mine methods will mine the corresponding ore on an asteroid. Each time the mine method is called it will try to mine up to 100 ore, depending on the efficiency.
You will mine 100 * the efficiency of the drill, which will always be less than 1 and greater than 0.
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date: