subject

Java question. 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 staticdouble 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 integerssystem. out. println("items: " + intval1 + " " + intval2 + " " + intval3); system. out. println("avg: " + tripleavg(intval1, intval2, intval3) + "\n"); // try tripleavg method with doublessystem. out. println("items: " + doubleval1 + " " + doubleval2 + " " + doubleval3); system. out. println("avg: " + tripleavg(doubleval1, doubleval2, doubleval3) + "\n"); return; }}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapy’s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
What are some settings you can control when formatting columns?
Answers: 1
You know the right answer?
Java question. this program currently fails to compile because the parameters cannot be automaticall...
Questions
Questions on the website: 13722363