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
Hoochie [10]
2 years ago
6

Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n

um2) { int product; product = num1 * (int)num2; System.out.println("The product is " + product); }
Computers and Technology
1 answer:
Alenkinab [10]2 years ago
3 0

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

You might be interested in
In terms of resource utilization, a /an application may require higher local
aksik [14]

Answer: A) Installed

Explanation: Installed application work on the system on which they are installed .They are supposed to persist the required speed of processing to execute the task ,enough memory and other resources as well to fulfill the need of the application functioning.

Other option is incorrect because cloud based application run with help of internet service via web browser so they resources in this applications based on the internet connectivity and browser's speed .Thus, the correct option is option(A).

3 0
3 years ago
The _____ feature will allow users to view nonprinting formatting marks to aid in editing a document. View Alignment Show/Hide I
Annette [7]

The __Show/Hide Insert___ feature will allow users to view non printing formatting marks to aid in editing a document.

The answer is D. Show/Hide Insert

Let me know if this is correct

5 0
2 years ago
How would you classify an employee who communicates effectively, listens to coworkers, and makes good decisions?
vovikov84 [41]
He is the ideal employee and works correctly
4 0
3 years ago
Read 2 more answers
Can anyone help with studying Epic AMB400 exam?
Wittaler [7]

Answer:

study Epic AMB400 using smart web and mobile flashcards created by top student, teachers and professor

8 0
2 years ago
Which of the following features of a network connection between a switch and server is not improved by link aggregation?
egoroff_w [7]

Answer: Speed

Explanation:

 Link aggregation is the process of a network connection between the switch and the server which are used for connections of the multiple parallel network. Line aggregations provides various advantages like increases the bandwidth, high availability and provides the fault tolerance but not speed because it increases the number of lanes not the speed as it is expensive and it does not increases the throughput of the system.

3 0
2 years ago
Other questions:
  • A network engineer is configuring a network to be able to relay IPv6 packets. The network only supports IPv4 and does not have d
    11·1 answer
  • Whos ready for sao ordinal scale this march!!!( ಥـْـِـِـِـْಥ)
    7·1 answer
  • What information should be included in the closing paragraph of a thank-you letter? a. Mention skills that were omitted during t
    6·2 answers
  • ListenListen with ReadSpeakerAn administrator working on a Windows Server 2016 Server Core installation needs to disable DHCP on
    9·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·2 answers
  • a(n) ___ loop allows you to cycle through an array without specifying the starting and ending points for the loop
    14·1 answer
  • Michael Holliday is a business systems analyst who is working on a feasibility study for a new​ e-911 system for the city of Mem
    6·1 answer
  • In c please
    7·1 answer
  • If every company is now a technology company, then what does this mean for every student attending a business college
    8·1 answer
  • What is adb command???​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!