1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anzhelika [568]
3 years ago
7

Write convert() method to cast double to int

Computers and Technology
1 answer:
Oksanka [162]3 years ago
3 0

Answer:

Explanation:

The code provided is written in Java. The statement is provided right under the /*Type your code here*/. In Java, in order to case one primitive to another you simply need to type the primitive type that you are trying to cast too before the variable and within parenthesis. The output of the new code can be seen in the attached image below.

class LabProgram {

   public static int convert(double d){

   /* Type your code here */

      return (int) d;

}

public static void main(String[] args) {

System.out.println(convert(19.9));

System.out.println(convert(3.1));

}

}

You might be interested in
Match the job roles with their appropriate qualifications
UNO [17]
Knowledge...- software QA engineer
Master’s...- business analyst
course...- network and computer admin
training...- multimedia artist
3 0
3 years ago
The History feature of a browser enables you to retrace your browsing history over a short period of time. (1 point) True False
Elena-2011 [213]

The statement that the History feature of a browser helps in retracing browsing history over a short period of time is True.

<h3>What is a browser?</h3>

A browser can be regarded as an computer application that is used in surfing the internet.

One of the features of a browser is the history tab which helps to retrace your browsing history over a short period of time.

Learn more about browsers at;

brainly.com/question/24858866

6 0
2 years ago
Fill in the blank to complete the sentence. -------------------- is used to store and process data over the Internet using compu
Trava [24]

Answer:cloud computing

Explanation:

6 0
2 years ago
What software tool can you use to see the applications that are currently running?
Soloha48 [4]

Answer:

You can use the task manager to see what programs are currently running.

Explanation:

7 0
2 years ago
Read 2 more answers
The best ways to navigate through your computer? a)Start button b)My Computer c)Windows explorer d)All of the above​
melomori [17]

Answer:

d all of above cause from tht all we can navigate through our pc

7 0
3 years ago
Other questions:
  • Do we have to use intersection?
    6·1 answer
  • Choose a film you have watched, or watch a film you have wanted to. Write a film review in at least three paragraphs. Describe w
    5·1 answer
  • Define a romanNumberToInt function that converts a RomanNumber value, which is a list of Roman digits, into an integer. Hints: -
    7·1 answer
  • Sandy's keyboard is not inputting data into her computer which key should she press to verify it is connected to her computer...
    11·1 answer
  • You and your friend who lives far away want to fairly and randomly select which of the two of you will travel to the other’s hom
    6·1 answer
  • Explain briefly why every person in the world is not connected to the Internet.
    9·1 answer
  • William wants to create a document using a DTP<br> what time saving techniques can he use?
    9·1 answer
  • Type of Factor Beginning Frog Count Simulation 1 (Low) Simulation 2 (High)
    13·1 answer
  • Calculate the time complexity for the following function in terms of Big O notation. Explain your answer.
    13·1 answer
  • Consider the following implementation of a search method:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!