subject

Write a class called Dragon. A Dragon should have a name, a level, and a boolean variable, canBreatheFire, indicating whether or not the dragon can breathe fire. The class should have getter methods for all of these variables- getName, getLevel, and isFireBreather, respectively. Dragon will alsomeed a constructor, a method to gain experience, and a method to attack. The constructor should take the name as the first argument and the level as the second argument. The constructor should initialize canBreatheFire based on the dragon's level. If the dragon is level 70 or higher, the dragon can breathe fire (meaning the third member variable should be set to true). You should create three getter (accessor) methods called getNameO getLevelO, and isFireBreatherO You should also create a method called attackO. This method does not return anything. If the dragon can breathe fire, it should print >>>999 1 public class Dragon private String name; private int level; private boolean canBreatheFire; 4 7 // Write the constructor here! public String getName(name) 9 10 return name; 12 13 14 - 15 public int getLevel(level) return level; 16 17 /Put getters here 18 19 20 21 221/ String representation of the object 23 24 - 25 26 27 3 28 // Put other methods here public String toStringO return "Dragon+ name +" is at level "+ level; 1 public class DragonTester extends ConsoleProgram 2 4 6 public void runCO // Start here! 7

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
You know the right answer?
Write a class called Dragon. A Dragon should have a name, a level, and a boolean variable, canBreath...
Questions
Questions on the website: 13722360