Question: Use the code from class Heater to answer the following questions. There can be more than one answer to each question. Choose all the answers




Use the code from class Heater to answer the following questions. There can be more than one answer to each question. Choose all the answers that apply. public class Heater bus private int temperature; private int min; private int max; private int increment; nate public Heater(int minimum, int maximum) min = minimum; max = maximum; temperature = 15; increment = 5; } public void warmer() { int newTemperature = temperature + increment; if(newTemperature = min) { temperature = newTemperature; } public void setincrement(int inc) { if(inc >= 0) { increment = inc; } public int getTemperature) { return temperature; } Which of the following methods are constructors? O public void warmer() O public void cooler() public void setIncrement(int inc) O public int getTemperature) Opublic Heater(int minimum, int maximum) U Question 2 Which of the following are accessor methods? o public void setIncrement(int inc) O public void cooler) public Heater(int minimum, int maximum) public int getTemperaturel) O public void warmer() Question 3 Which of the following are mutator methods? o public void setIncrement(int inc) o public void warmer() public int getTemperature) O public void cooler() Which of the following are fields (instance variables)? n temperature n increment n maximum n min = ccc n minimum n max newTemperature ning Question 5 Which of the following are formal parameters? n max ninc newTemperature n increment minimum n maximum n min Question 6 Which of the following are local variables? n minimum newTemperature minc n maxium n max increment n min n temperature Question 7 Which of the following methods contain a conditional (if) statement? n public int getTemperature) n public void warmer) n public void cooler) n public Heater(int minimum, int maximum) public void setIncrement(int inc) Question 8 What is the scope of temperature? n the method in which it is defined n the entire class Question 9 What is the scope of inc? the method in which it is defined n the entire class Question 10 What is the scope of newTemperature? n the method in which it is defined the entire class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
