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

Answers

Answer 1

Answer and explanation:

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.

public void showName(String name){

   System.out.println("Your name is " + name);

}

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:

public String getDouble(int x){

   int y = x * 2

   return y;

}

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.


Related Questions

17. What is something an employer might look for in person when hiring? (3
points)
A. Someone with a positive attitude
B. Someone with positive qualities such as honesty, tolerance, and
patience
C. Someone easy to work with
D. All of the above

Answers

D. all of the above
D. All the above

Why? Since all these qualities are valuable when hiring someone, you want them to be polite and respectful. It will also make working with this person better since you won’t have to deal with some rude or nasty.

Approximately how many tweets are posted on Twitter each day? 500 500 thousand 500 million 500 billion

Answers

Answer:

around 500 million

Explanation:

What are the types of text?

Answers

Answer: there are two main text types, factual and literary. Within these are many more narrowly defined text types. Factual text types include such types as factual description, recount, or persuasive. Literary text types include such types as poetry, narrative or personal response.

Answer:

Description sequeninstruction process cause-and-effect compare contrast problem and solution

Explanation:

there just soooo many types of texts bit theses are sum

list three rational number between-1 and 1​

Answers

Answer:3 numbers are -0.9  0.25 0.26

Explanation:

Answer:

oh god heartburn oh wait wrong question

Explanation:

The image shows a bar graph.

A bar graph shows a series of 4 vertical bars along an x and y axis.

In which scenarios would using this graph be best for a presentation? Check all that apply.

showing change in a community’s average median age over a century
comparing the percentages of the types of pets owned in a community
showing how the world’s shark population has changed over 50 years
comparing the number of men and women who earned engineering degrees in a decade
showing the percentages of the various religions practiced in Indonesia

Answers

Answer:

showing change in a community’s average median age over a century

showing how the world’s shark population has changed over 50 years.

comparing the number of men and women who earned engineering degrees in a decade

Explanation:

Which of the following types of information can be stored in an electronic database?
-Text
-Alphanumeric
-Date
-All of the above

Answers

All of the above I believe

The types of information that can be stored in an electronic database is text, alphanumeric, and also date. The correct option is D.

What is a database?

A database is a structured collection of information or data that is typically stored electronically in a computer system. A database management system is usually in charge of a database (DBMS).

Any collection of data or information that has been specially organized for rapid search and retrieval by a computer is referred to as a database.

Databases are designed to make it easy to store, retrieve, modify, and delete data in conjunction with various data-processing operations.

Text, alphanumeric, and date information are all examples of information that can be stored in an electronic database. A database's five major components are hardware, software, data, procedures, and database access language.

Thus, the correct option is D.

For more details regarding a database, visit:

https://brainly.com/question/6447559

#SPJ3

Help me please. I'LL MARK BRAINIEST

Answers

Answer:

A and B

Explanation:

yes

When you send large attachments, you are not
a. considering the needs of others
b. doing anything wrong
c. helping to maintain respectful communication
d. following social conventions
Please select the best answer from the choices provided
A
ОО
B
ОС

Answers

Answer:

c,becauses she is helping

Explanation:

thank me later

Answer:

A

Explanation:

i got a 100

Your ____ should always be bigger than your gutters

Answers

Always always always

Erin would like to add a photo to a presentation. However, she only has the printed copy of the photo. She does not have a digital copy. What should Erin do?

Answers

Answer:

Erin should scan the photo.

Took it on Edge <3

Answer:

Erin should scan the photo.

Explanation:

That´s what I thought :)

What is one ethical use of technology?

A.
Arguing with people on Twitter about various topics.

B.
Browsing the internet on your smartphone during class.

C.
Posting fake information on your social media accounts.

D.
Talking to friends and colleagues about interesting news.

Answers

Answer:

D.

Talking to friends and colleagues about interesting news.

Explanation:

Ethics is a branch of philosophy that "involves systematizing, defending, and recommending concepts of right and wrong behavior". So if something is "ethical" it is a right thing to do.

Definitely D
hope this helps :)

In the human digestive system, which mechanism is responsible for cutting and grinding food?

A) organ

B) stomach

C) teeth

D)
intestines

Answers

Answer:

teeth

Explanation:

the mechanism is teeth

Provides an array of buttons for quick access to commonly used commands and tools

A. scroll bar

B. tool bar

C. status bar

D. menu bar

Answers

Answer:Tool bar

Explanation:

The toolbar is said to provide an array of buttons for quick access to commonly used commands and tools. Through the toolbar, one can easily access the commands that are commonly used.

We can see the toolbar in several software like the graphics editor, office suites, and browsers.

The answer is B. Tool Bar!

The symbol is used to indicate that a line of text is a comment.

Answers

Answer:

Explanation:

asterisk

Answer:

# is the symbol you would use

Explanation:

I took the Unit Test on Edgen.

Ugh these are hard questions

Answers

9 is B, and 10 is D I think ... brainliest pls

Answers are 1-11, 3 is wrong

Answers

Answer:is the python

Explanation:

Use repl .it

The answer is 4

1:
3+2=5
2:
5+2=7
3:
7+2=9
4:
9+2=11
It would stop here as 11 is bigger than 10

Where do the projection lines converge in a perspective sketch?

Answers

Answer:

Option B, Vanishing point

Explanation:

The complete question is

Where do the projection lines converge in a perspective sketch?

A. the ground line

B. the vanishing line

C. the eye point

D. the horizon line

Solution

A point lying on the image of a perspective drawing where the drawings ( two-dimensional perspective projections) of two parallel line meet in three dimensional space is known as Vanishing point

WILL MARK BRIAN PLZ HELP PLZ I BEG YOU While levels often change in order to give a game some more variability, they might also change to tell more of the what?

Group of answer choices


game creation process


instructions


game story


animation

Answers

Answer:

Game story

Explanation:

Answer:

Game Story

Explanation:

is this very epik or not?

Answers

Answer:

e p i k ༼ つ ◕_◕ ༽つ

Answer:

much epic

Explanation:

Zareen used a school computer to create a fake
website where she posted pictures and rude
comments about her former friend.
What consequences could she face from school
officials for her actions? Check all that apply.
She could have her technology privileges taken
away.
She could face a severe financial penalty.
She could spend time in a juvenile detention facility.
She could face detention or suspension.
O She could be forbidden from attending school social
events.
She could be denied access to certain websites.

Answers

Answer: She could have her technology privileges taken away, She could face detention or suspension, She could be forbidden from attending school social events, She could be denied access to certain websites.

Explanation: ADEF on Edge 2021

The  consequences could Zareen  face from school are-

She could have her technology privileges taken away.She could be denied access to certain websites.She could face detention or suspension.What is a computer?

A computer is referred to as an electronic device that is used to perform arithmetic and logical operations quickly and accurately without causing any error in the result.

In the given case, it is explained that A girl named Zareen used a school computer to post comments inappropriate and rude comments about her former friend by creating a fake website.

This shows that Zareen has violated someone's personal privacy which can result in severe actions against her so the school may restrict her to use this kind of website.

As she disturbs someone's personal or social image it can cause her with suspension from school. The school may restrict her to use any kind of technology due to her immature and rude behavior.

Learn more about computers, here:

https://brainly.com/question/1380748

#SPJ5

Other Questions
Explain how and why weasels' coat color changes seasonally. A chemist prepares a solution of aluminum sulfate by weighing out of aluminum sulfate into a volumetric flask and filling the flask to the mark with water. Calculate the concentration in of the chemist's aluminum sulfate solution. Be sure your answer has the correct number of significant digits. Tafu is working with subatomic particles in the physics lab. a positron is traveling in a straight line down the particle accelerator. tafu models its position with the function p(t)= t2 t 1 where t>1. in the limit calculations below, if you need to use - or , enter -infinity or infinity. (a) calculate the limit A piano has 88 keys. Fifty-two of the keys are white.How many more white keys are there than black keys? How would a bacteria explore a non-coding portion of DNA? Martha, a first-grade teacher, is worried that if doesn't stay In at work to grade papers her principal will think she is lazy She is also worried that if she stays late at work her partner will be angry. This of conflict is known as In the passage the phrase "kill two birds with one stone" is used.What type of figurative language is this?(A)simile(B)metaphor(C)idiom(D)hyperbole Please help with this NEED HELP ASAP There 22 Question when using a cost benefit analysis model, how does one know which option should be chosen from a list of alternatives Writing an Argumentative Essay about an Injustice essay plz make one for me and youll get Brainliest and youll get credit for it 0.00002004 and 0.01203000 in scientific notation Dax is buying coffee for 5 people in his office. He also leaves a $2.00 tip for the barista.If his total, with tip, is $18.25, how much is each cup of coffee, not including the tip? Which revision corrects the inappropriate shift in verb mood? Thank you for your application to TopKids Dance Camp. We have scheduled your audition for 2:00 p.m. next Friday. Please bring a black- and-white headshot with you. The choreographer will go over the steps with you first. After that, you could perform two dances for our judges. You will be notified immediately if you pass the audition. A. After that, you will perform two dances for our judges. B. After that, our judges would ask you to perform two dances. C. After that, will you perform two dances for our judges? D. After that, you have performed two dances for our judges. plz help giving brainlist Which of the physical variables listed below will change when you change the area of the capacitor plates (while keeping the battery connected). a. Capacitanceb. Charge on the platesc. Voltage across the platesd. Net electric field between the platese. Energy stored in the capacitor What is 5884 diveded by 94? How do the valence electrons of an element determine how they will combine with other elements to produce a compound? Please help this is urgent :) How does a destructive force differ from a constructive force? Can someone please help I dont understand question 2