Computers and Technology

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));
}
}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:40, math31343
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, yayamcneal05
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, kayladgranger
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, ashleyd198308
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
Do you know the correct answer?
Write convert() method to cast double to int Complete the convert() method that casts the parameter...

Questions in other subjects:

Konu
Mathematics, 03.02.2021 20:10
Konu
Mathematics, 03.02.2021 20:10
Konu
Mathematics, 03.02.2021 20:10