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 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Donna and her team of five have invented a new gadget for the science exhibition in their college. which intellectual property right will protect their invention?
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print ā€¢ the average of the values. ā€¢ the smallest of the values. ā€¢ the largest of the values. ā€¢ the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Which best describes the condition under which the unicode output is the same as plain text ?
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
question
Mathematics, 15.12.2020 18:20
question
Mathematics, 15.12.2020 18:20
question
French, 15.12.2020 18:20
question
Mathematics, 15.12.2020 18:20
Questions on the website: 13722361