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, 22.06.2019 09:00
What is one way in which tablets differ from laptops and notebooks? tablets are designed for touch-based interaction. tablets are designed to be used as desktops. tablets are designed for input via a keyboard and mouse. tablets are designed to be larger than laptops.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
Someone plzz me which of these defines a social search? a. asking a search engine a question that is answered by a real person on the other sideb. modifying search results based on popularity of a web pagec.modifying search results based on a ranking of a web page
Answers: 2
You know the right answer?
Write convert() method to cast double to int Complete the convert() method that casts the parameter...
Questions
question
Mathematics, 30.07.2019 18:30
question
Mathematics, 30.07.2019 18:30
Questions on the website: 13722361