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
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
svlad2 [7]

Prison or juvenile detention of course, its a violation

4 0
3 years ago
Dam naj za pierwszej osobie która odpowie dobrze!
Rama09 [41]
I don’t understand that language
8 0
3 years ago
Congress are smart becuase.....
spin [16.1K]

Answer:

If we are talking about government then they are smart bc of there two house policies, both are equal yet super unique. They make sure each state has an equal voice in the senate.

5 0
2 years ago
10. In about 100 words Describe two or three social networking apps that could use a smartphone GPS capability be sure to make c
AlekseyPX

Answer:

Check the explanation

Explanation:

Almost all smartphone devices have global positioning satellite (GPS) service capabilities in them, which mean that apps will be able to combine the phone user's location with the available retail outlets and services to build better mobile business opportunities. For instance, some applications can navigate the user to a particular business locations (such as movie theaters, restaurants, or a nearby auto repair facilities) based on the user's present location.

App like twitter can use the GPS capability to tailor yhier user feeds and timelines with digital contents that are intresting to users in that location.

amazon can advertise based on the need of consumers in a particular location.

Google also tailor thier adword and adsense advert based on the location of the user.

6 0
3 years ago
An informative presentation can be used for conducting a classroom discussion.
Dmitrij [34]

Answer:

I think you have to ask you're teacher, not brainly because people on here can't answer this for you

3 0
2 years ago
Other questions:
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • In terms of object-oriented programming, after a class is defined,
    11·1 answer
  • What movie would be greatly improved if it was made into a musical?
    6·1 answer
  • The parameter passing mechanisn used in C is
    5·2 answers
  • Hi All,
    12·2 answers
  • New trends, tools, and languages emerge in the field of web technology every day. Discuss the advantages of these trends, tools,
    15·1 answer
  • Ethan wants to change the font in his document. He should _____.
    8·1 answer
  • Alice recently purchased a new cell phone. After her vacation, Alice wanted to transfer her holiday photos to her computer to do
    8·1 answer
  • What types of things were often NOT captured in early photographs?
    7·1 answer
  • A company organizes all of its client database in order of the amount of money that the account is worth. When a new account is
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!