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
- <em>public static void showProduct (int num1, double num2){</em>
- <em> int product;</em>
- <em> product = num1*(int)num2;</em>
- <em> System.out.println("The product is "+product);</em>
- <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 need answers to the question
A firewall is a programmed software that can be activated through setting. a firewall is designed to protect the computer from viruses and malware etc.
I personally hate it because it is always saying games from game jolt and even steam games are dangerous. hope i helped
Answer:
The solution code is written in Python:
- COST_PER_500MI = 1.1
-
- weight = float(input("Enter weight of package: "))
- total_cost = weight * COST_PER_500MI
- print("The shipping charges is $" + str(round(total_cost,2)))
Explanation:
Based on the information given in the question, we presume the cost per 500 miles is $1.10 per pound ($2.20 / 2 pound).
Create a variable COST_PER_500MI to hold the value of cost per 500 miles (Line 1). Next, prompt user input the weight and assign it to variable weight (Line 3). Calculate the shipping charge and display it using print function (Line 4-5).
Answer:
The answer would be D. The laptop's wireless radio is toggled to the off position.
Explanation: