subject

Write convert() method to cast double to int Complete the convert() method that casts the parameter from a double to an integer and returns the result.
Note that the main() method prints out the returned value of the convert() method.
Ex: If the double value is 19.9, then the output is:
19
Ex: If the double value is 3.1, then the output is:
3
public class LabProgram {
public static int convert(double d){
/* Type your code here *
}
public static void main(String[] args) {
System. out. println(convert(19.9));
System. out. println(convert(3.1));
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
Which of the following would you find on a network
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
question
Computers and Technology, 24.06.2019 08:00
How can smart devices benefit businesses, organizations, and social communities in the global marketplace?
Answers: 1
You know the right answer?
Write convert() method to cast double to int Complete the convert() method that casts the parameter...
Questions
question
Social Studies, 28.01.2020 23:57
question
English, 28.01.2020 23:57
question
Mathematics, 28.01.2020 23:57
Questions on the website: 13722367