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, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut-off on an hev are both colored orange.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Does anybody know how to hack into a google account? i had important information on it and it is gone now and i need getting it back.
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
German, 22.01.2021 18:20
question
Chemistry, 22.01.2021 18:20
Questions on the website: 13722360