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
Scilla [17]
4 years ago
5

When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it's appropri

ate to write a new function; at other times it's appropriate to write a loop. There is no hard-and-fast rule as to which is better, but what do you think? What kinds of circumstances would lead you to writing a function versus using a loop?
Computers and Technology
1 answer:
ddd [48]4 years ago
8 0

<u>Answer:</u>

<em>FUNCTION:</em>

  • A function does not require the number of times that the <em>code script needs to be executed </em>
  • When we go for large programming, ie. while creating projects, we can invoke function from one file to another based on the access <em>specifier mentioned for the function. </em>
  • There is a stack call created in the memory whenever a <em>function is called. </em>

<em>LOOP :</em>

  • Whereas the number of times that the loop has to be <em>executed must be defined </em>
  • A loop cannot be called, it can be used only the code block in <em>which it is present. </em>
  • There is not overhead of creating a stack since it is not invoked and there is no <em>transfer of control from one module to another </em>

You might be interested in
Consider the algorithm for determining whether a sequence of parentheses is balanced (has correct nesting). The pseudo code for
Katarina [22]

Answer:

3

Explanation:

The maximum number of symbols that will be on the stack would be 3. This is because according to the pseudocode every time that a left-facing symbol ( }, ], or ) ) it automatically ends the function or pops the last element in the stack. Therefore, the longest sequence of right-facing symbols would also equal the maximum number of symbols in the stack. In the sequence passed in the question, this would mean that the longest stack would be 3 and include the following sequence {[(

6 0
3 years ago
Which of these about non-disclosure agreements is accurate?
grandymaker [24]

Answer: number 2

Explanation: number 2

6 0
3 years ago
Read 2 more answers
Question 1 :George, a user, is having trouble connecting to network resources, including shared folders on the local network and
vazorg [7]

Complete Question:

George, a user, is having trouble connecting to network resources, including shared folders on the local network and Internet resources. Yesterday he was able to connect with no problems. You need to ensure that he can connect to these resources. Which tool should you use FIRST?

Group of answer choices

A. ipconfig

B. Device Manager

C. My Network Places

D. Control Panel

Answer:

A. ipconfig

Explanation:

As a network administrator, to ensure that George can connect to the network resources, shared folders, and internet resources, the tool you should use first is the "ipconfig" in the command line. This is a troubleshooting process that would help to identify the problem and to establish a theory of probable cause.

<em>Since George could connect the previous day without any problem, it is most likely that the TCP/IP settings has been altered. Therefore, to view this settings you'll have to use an ipconfig command. </em>

4 0
4 years ago
If a star system 30 parsecs distant is found to be broadcasting intelligent radio signals, then their news is already approximat
IrinaK [193]

Answer:

97.85 years, approximately.

Explanation:

Light travels at a <em>constant</em> speed of 186,000 mi/seg or 300,000km/seg accross the Universe (in vacuum conditions). Radio waves are also part of the electromagnetic spectrum, and they also travel at the same speed as Light does.

A light-year is a measure of the distance that Light travels during a year, that is,  5.88 trillion miles. Light travels the same distance per year because its speed is <em>constant</em>, and this is an excellent property that scientists take advantage to measure distances.

A parsec is 3.26 light-years (19 trillion miles), and (a very important datum to solve this question) one light-year is 0.306601 parsec, that is, in a year Light travels 0.306601 parsec at a <em>constant</em> speed. The same would happen with intelligent radio signals broadcasted from a distant star system.

So, considering all these facts, it is a matter of proportions to solve this question (mostly because speed of Light is constant):

\frac{1 year}{0.306601 parsec} = \frac{X years}{30 parsecs}

x =\frac{1 year * 30 parsec}{0.306601 parsec}

x = \frac{30}{0.306601} years

x = 97.84704 years or,

x = 97.85 years, approximately.

In other words, Light spends 97.85 years (terrestials) to travel 30 parsecs.

Likewise, radio waves travel at the same speed, so they spend the same years (97.85 years) travelling across the Universe to be finally detected by a radiotelescope located, for instance, here, in our planet.

Finally,  the star system broadcasted intelligent radio signal with 'news' that are already approximately 97.85 years old'.

6 0
3 years ago
Which statement about the subject line is true? The subject line can be found just below the message box. The subject line is ma
charle [14.2K]
Filling in the subject line is optional, but it is a good practice.
5 0
4 years ago
Read 2 more answers
Other questions:
  • Spencer is a recent graduate who finds a dream car that costs $45,000. Even better, there's a 0% APR for 36 months offer from th
    13·1 answer
  • Many people blame online shopping for the demise of the high street. Discuss why high street shops find it difficult to compete
    12·1 answer
  • An___ is a rectangular work area in the desk top that contains a program, text, files, it other data and tools.
    5·1 answer
  • The small gear that is driven by the motor shaft of a rotisserie is called a?
    9·1 answer
  • In computer Drag and Drop“ means to select the items, hold down the mouse and
    15·1 answer
  • Why were spices very important 500 yr and what did people use them for
    8·1 answer
  • Greg works outside. He is often found cutting grass and making the local park grounds look nice for guests.
    10·1 answer
  • Which of the following transferable skills are generally the most look for in the it <br> field
    10·1 answer
  • Input a list of positive numbers, terminated by 0, into an array Numbers[]. Then display the array and the largest and smallest
    11·1 answer
  • A higher resolution image will mean a?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!