a Java file for Trainer class that will produce given sample output int money -int potions -int
Fantastic news! We've Found the answer you've been seeking!
Question:
a Java file for Trainer class that will produce given sample output
Transcribed Image Text:
int money -int potions -int pokeballs - Point loc - Map map Trainer ArrayList<Pokemon>pokemon + Trainer(String n, Pokemon p, Map m) +int getMoney) +boolean spend Money(int amt) +void receiveMoney(int amt) +boolean hasPotion() +void receive Potion() +void usePotion(int pokelndex) +boolean hasPokeball() + void receivePokeball <abstract> Entity String name -int hp -int maxHp + Entity(String n, int mHp) +int getHp0 + int getMaxHp) +void takeDamage(int d) + void heal() + String getName() + String toString() Main + static void Main(String[] args) +static int mainMenu() + static Pokemon choose RandomPokemon() + static void trainerAttack (Trainer t, Pokemon wild) + static void store(Trainer t) Charmander Charmander +boolean catchPokemon(Pokemon p) <abstract> Pokemon Ponyta + static final double [][] battleTable = Ponyta {{1,.5,2), (2,1,.5), (.5,2,1}} Squirtle + Pokemon(String n) +Point getLocation() +char goNorth + char goSouth +char goEast) +char goWest) +int getNumPokemon() +void healAllPokemon + Pokemon getPokemon(int index) + String getPokemonList() + String toString() char Мар map - boolean revealed + Map() +void loadMap(int mapNum) +char getCharAtLoc(Point p) String mapToString(Point p) + Point findStart +void reveal(Point p) + void removeCharAtLoc(Point p) + abstract String getSpecial Menu() + abstract int getNumSpecial Menultems() +abstract String specialAttack(Pokemon p, int move) + String getBasicMenu() +int getNumBasicMenuItems() + String basicAttack(Pokemon p, int move) +String getAttackMenu() + int getNumAttack Menultems() +String slam(Pokemon p) + String tackle(Pokemon p) +String punch(Pokemon p) +int getType() | + Squirtled Staryu + Staryu() Bulbasaur Bulbasaur() Oddish + Oddish <interface> Fire + String specialMenu = "1. Ember\n2. Fire Blast\n3. Fire Punch" +int numSpecialMenultems - 3 + String ember(Pokemon p) +String fireBlast(Pokemon p) + String firePunch(Pokemon p) <interface> Water String specialMenu "1. Water Gun\n2. Bubble Beam\n3. Waterfall" +int numSpecialMenultems = 3 + String waterGun(Pokemon p) + String bubbleBeam(Pokemon p) + String waterfall(Pokemon p) <interface> Grass + String specialMenu = "1. Vine Whip\n2. Razor Leaf\n3. Solar Beam" +int numSpecialMenultems = 3 + String vineWhip(Pokemon p) + String razorLeaf(Pokemon p) + String solarBeam(Pokemon p) int money -int potions -int pokeballs - Point loc - Map map Trainer ArrayList<Pokemon>pokemon + Trainer(String n, Pokemon p, Map m) +int getMoney) +boolean spend Money(int amt) +void receiveMoney(int amt) +boolean hasPotion() +void receive Potion() +void usePotion(int pokelndex) +boolean hasPokeball() + void receivePokeball <abstract> Entity String name -int hp -int maxHp + Entity(String n, int mHp) +int getHp0 + int getMaxHp) +void takeDamage(int d) + void heal() + String getName() + String toString() Main + static void Main(String[] args) +static int mainMenu() + static Pokemon choose RandomPokemon() + static void trainerAttack (Trainer t, Pokemon wild) + static void store(Trainer t) Charmander Charmander +boolean catchPokemon(Pokemon p) <abstract> Pokemon Ponyta + static final double [][] battleTable = Ponyta {{1,.5,2), (2,1,.5), (.5,2,1}} Squirtle + Pokemon(String n) +Point getLocation() +char goNorth + char goSouth +char goEast) +char goWest) +int getNumPokemon() +void healAllPokemon + Pokemon getPokemon(int index) + String getPokemonList() + String toString() char Мар map - boolean revealed + Map() +void loadMap(int mapNum) +char getCharAtLoc(Point p) String mapToString(Point p) + Point findStart +void reveal(Point p) + void removeCharAtLoc(Point p) + abstract String getSpecial Menu() + abstract int getNumSpecial Menultems() +abstract String specialAttack(Pokemon p, int move) + String getBasicMenu() +int getNumBasicMenuItems() + String basicAttack(Pokemon p, int move) +String getAttackMenu() + int getNumAttack Menultems() +String slam(Pokemon p) + String tackle(Pokemon p) +String punch(Pokemon p) +int getType() | + Squirtled Staryu + Staryu() Bulbasaur Bulbasaur() Oddish + Oddish <interface> Fire + String specialMenu = "1. Ember\n2. Fire Blast\n3. Fire Punch" +int numSpecialMenultems - 3 + String ember(Pokemon p) +String fireBlast(Pokemon p) + String firePunch(Pokemon p) <interface> Water String specialMenu "1. Water Gun\n2. Bubble Beam\n3. Waterfall" +int numSpecialMenultems = 3 + String waterGun(Pokemon p) + String bubbleBeam(Pokemon p) + String waterfall(Pokemon p) <interface> Grass + String specialMenu = "1. Vine Whip\n2. Razor Leaf\n3. Solar Beam" +int numSpecialMenultems = 3 + String vineWhip(Pokemon p) + String razorLeaf(Pokemon p) + String solarBeam(Pokemon p) int money -int potions -int pokeballs - Point loc - Map map Trainer ArrayList<Pokemon>pokemon + Trainer(String n, Pokemon p, Map m) +int getMoney) +boolean spend Money(int amt) +void receiveMoney(int amt) +boolean hasPotion() +void receive Potion() +void usePotion(int pokelndex) +boolean hasPokeball() + void receivePokeball <abstract> Entity String name -int hp -int maxHp + Entity(String n, int mHp) +int getHp0 + int getMaxHp) +void takeDamage(int d) + void heal() + String getName() + String toString() Main + static void Main(String[] args) +static int mainMenu() + static Pokemon choose RandomPokemon() + static void trainerAttack (Trainer t, Pokemon wild) + static void store(Trainer t) Charmander Charmander +boolean catchPokemon(Pokemon p) <abstract> Pokemon Ponyta + static final double [][] battleTable = Ponyta {{1,.5,2), (2,1,.5), (.5,2,1}} Squirtle + Pokemon(String n) +Point getLocation() +char goNorth + char goSouth +char goEast) +char goWest) +int getNumPokemon() +void healAllPokemon + Pokemon getPokemon(int index) + String getPokemonList() + String toString() char Мар map - boolean revealed + Map() +void loadMap(int mapNum) +char getCharAtLoc(Point p) String mapToString(Point p) + Point findStart +void reveal(Point p) + void removeCharAtLoc(Point p) + abstract String getSpecial Menu() + abstract int getNumSpecial Menultems() +abstract String specialAttack(Pokemon p, int move) + String getBasicMenu() +int getNumBasicMenuItems() + String basicAttack(Pokemon p, int move) +String getAttackMenu() + int getNumAttack Menultems() +String slam(Pokemon p) + String tackle(Pokemon p) +String punch(Pokemon p) +int getType() | + Squirtled Staryu + Staryu() Bulbasaur Bulbasaur() Oddish + Oddish <interface> Fire + String specialMenu = "1. Ember\n2. Fire Blast\n3. Fire Punch" +int numSpecialMenultems - 3 + String ember(Pokemon p) +String fireBlast(Pokemon p) + String firePunch(Pokemon p) <interface> Water String specialMenu "1. Water Gun\n2. Bubble Beam\n3. Waterfall" +int numSpecialMenultems = 3 + String waterGun(Pokemon p) + String bubbleBeam(Pokemon p) + String waterfall(Pokemon p) <interface> Grass + String specialMenu = "1. Vine Whip\n2. Razor Leaf\n3. Solar Beam" +int numSpecialMenultems = 3 + String vineWhip(Pokemon p) + String razorLeaf(Pokemon p) + String solarBeam(Pokemon p)
Expert Answer:
Answer rating: 100% (QA)
Below is a Java implementation of the Trainer class based on the provided sample output import javautilScanner public class Trainer private String nam... View the full answer
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
In this programming assignment you will practice using ArrayLists, Inheritance and Polymorphism. You are to write a game called Magical Creatures War. You will do this by implementing a class called...
-
A long, slender bar in the shape of a right circular cone with length L and base diameter d hangs vertically under the action of its own weight (see figure). The weight of the cone is W and the...
-
Calculate the following: a. The first year of depreciation on a residential rental building costing $200,000 purchased June 2, 2016. b. The second year of depreciation on a computer costing $1,500...
-
In Exercises 13 through 28, sketch the graph of the given function. Include all x and y intercepts. f(x) =x 2 2x + 15
-
Reconsider the data from Problem 56. What is the capital recovery cost of Model 127B? Data from problem 56 Octavia Bakery is planning to purchase one of two ovens. The expected cash flows for each...
-
On January 1, 2012, Roosevelt Company purchased 12% bonds, having a maturity value of $500,000, for $537,907.40. The bonds provide the bondholders with a 10% yield. They are dated January 1, 2012,...
-
Find the solution of the equation coth x = a, assuming that a > 1. Express the result in terms of elementary functions of a. [Hint: The result should have the form x = f(a), where f(a) is a specific...
-
On January 1, 2019, Palma Associates purchased 12,000 shares of the outstanding common stock of Baylor Company for $570,000. The assets of Baylor Company had the following values on January 1, 2019....
-
A series, or stream, of cash flows may not always necessarily be an annuity. Cash flows can also be uneven and nonconstant, but the concept of the time value of money applies to uneven cash flows as...
-
Who was Marie Tagliofil and what did she contribute to the To" century Romantic era Of ballet? (Video. Romantic Era- Marie Taglioni 1804-1884) What was ballet dancer Anna Pavlova known for? How has...
-
Arrow wants to buy a new item of equipment which will be used to provide a service to customers of the company. Two models of equipment are available, one with a slightly higher capacity and greater...
-
What types of messages would you personally need extra elaboration on to sway you more one way or another? Out of the 5 influences on motivation, which one would be more effective when trying to...
-
Which kind of ad would you have been most likely to click? Was this because the ad was superior or simply because it matched your idiosyncratic preferences better? (If there is only one ad, analyze...
-
ACTIVITY 4: A Moment to Level Up in Rotational Inertia Directions: Read and understand the situation given below. Solve for the moment of inertia of the system of objects and show your solution....
-
What is the purpose of the journal wizard?
-
Assume that a stack has been declared and instantiated with the ArrayDeque class. Show the output produced by the following code fragment: You should be able to do this by just thinking about it, but...
-
Given the following program skeleton. Replace with a createContents method such that the resulting window matches the customer feedback window shown earlier in this chapter, in the TextArea Control...
-
In the printReverseMessage method of Figure 11.7, what variable changes as the recursion progresses, and what is the stopping condition? Figure 11.7 private static void print Reverse Message(String...
-
Consider the dynamic system, a mass, spring and damper structure, shown in Figure 2.2. (a) Draw a free-body diagram for the dynamic system (b) Derive the Input-Output model of the dynamic system k...
-
Two connected cars with an applied input force \(u(t)\) and negligible rolling friction can be represented by a translational mechanical system as shown below. (a) Draw the free-body diagrams of this...
-
Consider an RLC circuit consisting of a resistor \((R)\), an inductor \((L)\), and a capacitor \((C)\), connected in series, as depicted in Figure 2.4. Derive the Input-Output model of the network....
Study smarter with the SolutionInn App