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 are three responsibilities of an operating system? please answer quick!!!
Dennis_Churaev [7]
Same here thank you
3 0
2 years ago
Answer for 3.4.8 rectangle code HS
tigry1 [53]

Answer:

i think Make variables to represent the length and width of a rectangle, called length

and width

, respectively. You should set length

to 10 and width

to 5.

Then, write some mathematical expressions to computer the area and perimeter of the rectangle and save these values inside variables named area and perimeter

.Use print

statements to display the area and perimeter of the rectangle.

Your output should print the area on the first line and the perimeter on the second, like this:

50 30  Rectangle Area Formula:

Area = L * W

Explanation:

7 0
3 years ago
The 8086 was divided into two main parts. The _____ was the "brain" of the processor, and had the ALU, general-purpose register,
jonny [76]

Answer:

1.Execution Unit.  2.Bus interface unit

Explanation:

3 0
3 years ago
In 2-5 paragraphs, describe the points that Kendra needs to consider when choosing a telecommunications technology to meet her n
never [62]

Answer:

For marketing requirements, various communication mediums like digital communication medium, as well as non digital traditional communication medium can be used. Some like Blogs, Article directories, forums etc. can be used.

However, the AI, ML, DL and the traditional statistical analysis from Data Science can also be used. You need to install on your blog the chat-bots, And through the Chat-bots we can make a data set, that is in fact automatically generated, and contains email, phone numbers, addresses etc, and this data base can be used to run the Amazon Sage-makers. and a lot of meaningful information can be achieved through the prepared data-set through the Sage-maker.

Thus, you can find out quite easily what is good.

Sage maker, Chat bots and Blog technology is quite cost effective as well.

Explanation:

The above details covers all the requirements.

7 0
2 years ago
Which of the following questions will most likely be answered by displaying data on a line graph?
Artemon [7]
I'm pretty sure the answer is b
4 0
3 years ago
Other questions:
  • What does bam file stand for computer terms?
    9·1 answer
  • Write an expression that evaluates to 1 more than the value in the location pointed to by the integer pointer variable ip. Thus,
    8·1 answer
  • What is the part of the browser window that displays the content of the web page such as pictures and text called?
    10·1 answer
  • Which of the following function headings arevalid? If they are invalid, explain why.
    12·1 answer
  • To what would you compare the transport layer?
    14·1 answer
  • Write a program that will print out statistics for eight coin tosses. The user will input either an "h" for heads or a "t" for t
    14·1 answer
  • knowledge contributes vitally to the development of __________ memory, or recollections of personally experienced events that oc
    12·1 answer
  • Which line of code will find the first occurrence of a three in an array?
    5·2 answers
  • Pls help... : Slide layouts can be changed by _____.
    9·1 answer
  • In PowerPoint, a picture might be a photograph, a shape you draw, a piece of clip art, or an illustration created using a graphi
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!