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
Effectus [21]
3 years ago
12

What are the benefits of writing functions that use parameters and return List 2 please and explain what is return

Computers and Technology
1 answer:
Ratling [72]3 years ago
3 0

<u>Answer and explanation:</u>

There are many benefits of writing functions that use parameters and return. Some of them are:

1. Flexibility: With functions having parameters, several values of the parameters can be used at invocation time thereby making the application flexible. For example, given the following function in Java.

<em>public void showName(String name){</em>

<em>    System.out.println("Your name is " + name);</em>

<em>}</em>

To call this method (function), the programmer could use various values for the name parameter used in the function like so:

showName("John");

showName("Doe");

If the function didn't have a parameter, it is possible it will only print a hardcoded name every time the function is called.

2. Scope Control: When a function is allowed to return a value, it helps to work around scope issues since variables declared within a function are limited to that function and do not exist outside the function. This means that the values of these variables cannot be used anywhere else outside the function in which they are being declared. However, if the function returns a value, the value can be used anywhere else in the program.

For example:

<em>public String getDouble(int x){</em>

<em>    int y = x * 2</em>

<em>    return y;</em>

<em>}</em>

The function above returns twice the value of the argument supplied to it. Since the integer variable y is declared within the function, it's value cannot be used outside the function. However, since the value is being returned by the function, it could be used anywhere the function is being called. Thanks to the return keyword.

You might be interested in
In an agile team who is responsible for tracking the tasks
Alik [6]

Answer:

All team members

Explanation:

In respect of the question, the or those responsible for tracking the tasks in an agile team comprises of all the team members.

Agile in relation to task or project management, can be refer to an act of of division of project or breaking down of project or tasks into smaller unit. In my opinion, these is carried out so that all team members can be duly involved in the tasks or project.

5 0
3 years ago
Applications require you to provide the following basic elements : name, contact information, and availability. True or False
iren2701 [21]

True

Companies will not hire unless they know your name, availability, email, phone number, and any other legal personal information that they need to know

6 0
3 years ago
multimedia is an effective tool used in different fields such as business and education true or false​
weeeeeb [17]

Answer:

True

Explanation:

Multimedia is used in many fields. It is basically the ability to express something in many different ways. This allows you to more easily demonstrate a product, idea, or even a theory. Since this can be through art, video, presentation, text, live, etc. It allows you to find the best format for the specific product or idea that you are trying to present to a group of viewers. That is why it is an effective tool for various fields since it can just as easily help a company sell a product as well as help a teacher express a mathematical concept.

3 0
3 years ago
Can Anybody Answer This
Gre4nikov [31]

Answer:

1 2 and 3 (A) give me brainiest

8 0
3 years ago
What is memory in computer
oksian1 [2.3K]

Answer:

storage used

Explanation:

Memory refers to the amount of storage used a computer has, such as 20GB of Memory out of 25GB Storage(20/25 GB used)

6 0
3 years ago
Other questions:
  • The c++ operator _______________ is used to destroy dynamic variables.
    5·1 answer
  • You have activated pop-up blockers in your web browser to prevent pop-up windows from continually interrupting your browsing exp
    14·2 answers
  • How to hard reset a iphone 7 without computer
    8·2 answers
  • The do-while loop is a __________ loop that is ideal in situations where you always want
    6·1 answer
  • Please state 5 lasting effects about Artificial Intellegence
    12·2 answers
  • Hi guys, Im making a game. I want to make a collision event, but what is the code for making the wall and the box collide. I rea
    6·1 answer
  • Specialized high-capacity second storage devices designed to meet organizational demands
    12·2 answers
  • What method of thermal energy is at work when heat lamps are used to warm up baby chickens?
    11·2 answers
  • What do hard disk drive use to store data
    10·1 answer
  • JAVA -Develop a program that prompts the user to enter a series of 10 integers and then determines and displays the largest and
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!