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
Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
r-ruslan [8.4K]

Answer:

switchboard

Explanation:

The option that he should implement would be a switchboard interface design. These design structures for graphic user interfaces use a single main page, large icons/buttons, a fixed navigation menu, and all the necessary functionality right in front of the user. This design is made with simplicity in mind in order to make it as easy as possible for a new user to pick up and efficiently and intuitively navigate the user interface. Therefore, since Calvin needs a simple yet professional design, this would be the best implementation.

7 0
2 years ago
Read 2 more answers
Should I learn Python, C++, C# or VB to start off programming games for Windows. Open to other language recommendations as well!
Svetllana [295]
In theory, you can of course use any language you like, but there are a few commonly used ones.
From your list it would be c++ or c#, because if you actually have the interest long term then those will be the languages used by the various "big"/well known/used engines.
I would suggest c#, because it can be used with the Unity engine, which has an enormous community with help resources especially to start out and learn to program or game development.
On the other hand I would also suggest JavaScript. It isn't used for any of the big title development, but for all the *.io games like slither and so on. When looking at such games you will quickly notice that they are generally much simpler (for example 2D not 3D), because game engines are just simpler in JavaScript. While this is obviously limiting it might help to get something simple actually working, instead of getting stuck in extra complexities and additional features until you lose your motivation.
The basic programming you learn is still the same, so after you have learned a language you can quickly pick up most others.
<span />
7 0
3 years ago
If an object moves without rotation or angular displacement, it is called translation.
NikAS [45]

Hi!


The answer is True.


Angular displacement is defined as the angle an object travels through, in a circular path, or in other terms -rotation.

Translation is a type of geometric transformation which results in the motion of each point on an object in a particular direction by the same distance. An object moving without rotation is said to have a movement known as translation.


Hope this helps!

7 0
3 years ago
You're a ticket agent for a commercial airline and responsible for checking the identification for each passenger before issuing
algol13

Answer:

Follows are the code to this question:

import java.util.*;//import package for user input  

public class Main //defining class  

{

  public static void main(String[] as)//main method

  {

      boolean x,y,z;//defining boolean variable

      Scanner ox= new Scanner(System.in);//create Scanner class object for user input

      System.out.println("input value: "); //print message  

      x=ox.nextBoolean();//input value

      y=ox.nextBoolean();//input value

      z=ox.nextBoolean();//input value

      System.out.println("Output: ");//print message

      System.out.println(x || (y &&z));//use print method to check value and print its value  

  }

}

Output:

1)

input value:  

true

false

false

Output:  

true

2)

input value:  

false

true

true

Output:  

true

3)

input value:  

false

false

false

Output:  

false

Explanation:

In the given code, inside the class three boolean variable "x,y, and z" is declared, that uses the scanner class for input the value from the user end, and in the next print, the method is declared, that uses " OR and AND" gate for calculating the input value and print its value.

In the AND gate, when both conditions are true. it will print the value true, and in the OR gate, when one of the conditions is true, it will print the value true.  

3 0
3 years ago
• what command-line utility can you use to assign the correct dns server ip address
Lilit [14]
On A Windows machine, you can use the netsh command.
<span>netsh interface ip set dns name="Local Area Connection" static 208.67.222.222

All the steps below means you have access to the router via Telnet or physical access  and it already has a valid configuration (except the DNS)
On a Cisco Router is:
</span><span>Step 1:  <span>enable 
</span></span><span>Step 2: <span>configure <span>terminal 
</span></span></span><span>Step 3: <span>Do one of the following: <span><span>ip domain name name
                                                       </span><span><span>ip domain list </span><span>name
</span></span></span></span></span><span>Step 4 : Device(config)# ip name-server 172.16.1.111 172.16.1.2</span>
5 0
3 years ago
Other questions:
  • A software program that enables users to find and display information stored as html pages on the internet is a(n) ____.
    5·1 answer
  • A risk handling technique in which the organization chooses to simply do nothing, as the cost of the risk being actualized is lo
    15·1 answer
  • Basic rule for java languague
    13·2 answers
  • Which software programs should students avoid using to create and submit course work? (Choose all that apply).
    6·1 answer
  • What is a case in programming​
    12·1 answer
  • Ssssssssssssssssssssssssssssssssssssssssssssssssss 100 points for this answer too.
    10·1 answer
  • Which discipline focuses on the design of computer hardware?
    5·2 answers
  • With _____ technology, a web server delivers information to users, who have signed up for the service, instead of waiting for th
    5·1 answer
  • Pleaseeeee helpppppppp​
    7·1 answer
  • What are two reasons to tie cables up and out of the way inside a computer case?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!