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
zheka24 [161]
3 years ago
7

Suppose that you have created a program with only the following variables.int age = 34;int weight = 180;double height = 5.9;Supp

ose that you also have a method with the following header:public static void calculate(int age, double size)Which of the following method calls are legal?a. calculate(age, weight);b. calculate(age, height);c. calculate(weight, height);d. calculate(height, age);e. calculate(45.5, 120);f. calculate(12, 120.2);g. calculate(age, size);h. calculate(2, 3);i. calculate(age);j. calculate(weight, weight);
Computers and Technology
1 answer:
Yuri [45]3 years ago
3 0

Answer:

a. calculate(age, weight); // This is legal

b. calculate(age, height); // This is legal

c. calculate(weight, height); // This is legal

d. calculate(height, age); // This is not legal

e. calculate(45.5, 120); // This is not legal

f. calculate(12, 120.2); // This is legal

g. calculate(age, size); // This is not legal

h. calculate(2, 3); // This is legal

i. calculate(age); // This is not legal

j. calculate(weight, weight); // This is legal

Explanation:

a. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

b. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

c. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

d. This is not legal because even though two parameters were passed. The first one should be int but double was supplied and double cannot be downgraded to int. There is a possible lossy conversion from double to int.

e. This is not legal because even though two parameters were passed. The first one should be int but double was supplied and double cannot be downgraded to int. There is a possible lossy conversion from double to int.

f. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

g. This is not legal because even though two parameters were passed. The first one should be int but the second parameter is not defined before been passed to the calculate method.

h. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

i. This is not legal because only one parameter was passed instead of two.

j. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

You might be interested in
Programming Cycle. Arrange them in correct order​
MAVERICK [17]

Answer:

The program cycle is a series of steps that your program repeats until an end-of-file condition is reached. Depending on the specifications you code, the program may or may not use each step in the cycle. I hope this helps :)

Explanation:

5 0
2 years ago
Read 2 more answers
It is unlawful in the State of Florida for any person, ______________________, to be a passenger in the front seat of a motor ve
Komok [63]
In florida, if you're sitting in the front seat, you always need to wear a seatbelt regardless of age. So D
5 0
3 years ago
Students recently created a Gaming Club at their school. On Friday of every week, students bring in their gaming consoles (Xbox,
ozzi

Answer:

first line, that is "The bandwidth of the school’s internet connection is lower than at home" is the correct answer.

Explanation:

The network school bandwidth, speed, and list of phones can all be considerations here. In school might have a network that does not allow high MBPS or via its ISP, it might have a low bandwidth plan. It based on the router's size, frequency, and link of the firewall and gaming network, the bandwidth may be lower.

  • The Most probably, the device isn't the source but it acts in the match were caused by the link.
  • If the school requires the server for transport broadband connections, the network can slow the process through pc specifications and link to either the network.

8 0
3 years ago
Waterpower was first harvested by ancient societies using
Maslowich
Not sure why this question is in Computers and Technology...

Answer should be c.
6 0
3 years ago
For angular how can we set up th edatabse.
lesya [120]
You can not communicate directly between Angular and MySQL. You'll need to build a back-end Web service that calls MySql using php or node. Angular can communicate with this back-end Web service via http.
8 0
3 years ago
Other questions:
  • Pete Jones, a bait shop owner, incorporates ______ within a webpage to entice customers to buy a new lure.
    7·1 answer
  • What happens when your computer is in Hibernate mode?
    12·1 answer
  • Your motherboard supports dual channeling and you currently have two slots used in channel a on the board; each module holds 1 g
    15·1 answer
  • What mass of nh3 can be made from 35g of n2?
    14·1 answer
  • You are given two int variables j and k, an int array zipcodeList that has been declared and initialized, an int variable nZips
    10·2 answers
  • As an improvement of the ATX form factor over AT, shorter wires made it easier to shield them and made them capable of handling
    6·1 answer
  • Why is it important to evaluate the website on which you plan to shop?
    7·2 answers
  • Once secured a wheelchair may move up to 6 inches in any direction
    6·1 answer
  • In the space provided, analyze the pros and cons of becoming a member of an artistic guild. Your answer should be at least 150 w
    12·1 answer
  • What are the two most common input and output devices?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!