![subject](/tpl/images/cats/User.png)
Engineering, 18.11.2019 19:31 ang233499
This program currently fails to compile because the parameters cannot be automatically converted to double in the statement triplesum = item1 + item2 + item3; . because thetype is bound to the class number, the number class' doublevalue() method can be called to get the value of the parameters as a double value. modify tripleavg() method to use the doublevalue() method to convert each of the parameters to a double value before adding them.
public class itemminimum {
public static
double tripleavg(thetype item1, thetype item2, thetype item3) {
double triplesum = 0.0;
triplesum = item1 + item2 + item3;
return triplesum / 3.0;
}
public static void main(string[] args) {
integer intval1 = 55;
integer intval2 = 99;
integer intval3 = 66;
double doubleval1 = 14.5;
double doubleval2 = 12.3;
double doubleval3 = 1.75;
// try tripleavg method with integers
system. out. println("items: " + intval1 + " " + intval2 + " " + intval3);
system. out. println("avg: " + tripleavg(intval1, intval2, intval3) + "\n");
// try tripleavg method with doubles
system. out. println("items: " + doubleval1 + " " + doubleval2 + " " + doubleval3);
system. out. println("avg: " + tripleavg(doubleval1, doubleval2, doubleval3) + "\n");
return;
}
}
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Engineering
![image](/tpl/images/cats/User.png)
![image](/tpl/images/cats/User.png)
Engineering, 04.07.2019 18:10, danksans7011
The mass flow rate of the fluid remains constant in all steady flow process. a)- true b)- false
Answers: 1
![image](/tpl/images/cats/User.png)
Engineering, 04.07.2019 18:10, viicborella
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
![image](/tpl/images/cats/User.png)
Engineering, 04.07.2019 18:10, jadeochoa4466
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
You know the right answer?
This program currently fails to compile because the parameters cannot be automatically converted to...
Questions in other subjects:
![Konu](/tpl/images/cats/es.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 26.08.2019 20:30
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 26.08.2019 20:30
![Konu](/tpl/images/cats/health.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 26.08.2019 20:30
![Konu](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 26.08.2019 20:30