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]
3 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]3 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
10 points if right...
aivan3 [116]

email because with chat it might wake up the kids and wbsite doesnt make sense. neither does blog so with email you can give personal messages and pictures.

7 0
3 years ago
Read 2 more answers
In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.cpp, calc
Ne4ueva [31]

Answer:

#include <iostream>

using namespace std;

int main() {

int currentYear = 2020;

int myCurrentAge = 23;

int myNewAge=myCurrentAge+(2050-currentYear);

cout << "My Current Age is " << myCurrentAge << endl;

cout << "I will be " << myNewAge << " in 2050." << endl;

}

Explanation:

  • Initialize the currentYear with 2020 and myCurrentAge with 23.
  • Add myCurrentAge with the the result of (2015 - currentYear) and assign this result to myNewAge variable.
  • Finally display my current age and after that display the new age in 2050.

Output:

My Current Age is 23

I will be 53 in 2050.

6 0
3 years ago
="Jack"&amp;"$"&amp;"Jill". What will be the output of this formula?​
natita [175]
I’m so confused on this but hey here’s this

3 0
2 years ago
Program your own file lab7.cpp in which your main() function will test the new data structure. The main() function, Declares an
Stella [2.4K]
Is this a question or just something up here just to be here
3 0
3 years ago
Taking into account recent technological developments, what technical advances do you think are possible in the next twenty year
stiv31 [10]

Nuclear Fusion reactors may reach the prototype commercial stage , The causes and possible treatment of Alzheimers Disease  and Partial cloning of human organs for transplant therapy

Explanation:

Fusion may be an energy technology that seems to be perpetually coming over the horizon, but projects around the world such as SPARC are getting increasingly close to reactors that, although smaller in capacity, can produce net positive power in just a few years. To help accelerate discovery of permanent cure for Alzheimers, an alliance of pharmaceutical companies, nonprofit foundations and government advisers, has developed a partnership to share data from Alzheimer's clinical trials. This would definitely pave way for the permanent cure for Alzheimer. The most common method of therapeutic and reproductive cloning is somatic cell nuclear transfer (SCNT). SCNT involves separating the nucleus from a donor egg, and replacing it with the DNA from the organism meant to be cloned. Scientists could potentially clone organs with SCNT by cloning embryos, extracting the stem cells from the blastocyst, and stimulating the stem cells to differentiate into the desired organ. these three scientific and technological advancements are possible.

8 0
3 years ago
Other questions:
  • When you begin typing text, the _________________________ appears on the status bar with an animated pencil writing on paper tha
    15·1 answer
  • How many times go you need to click the format painter button to apply copied formats to multiple paragraphs one right after the
    5·2 answers
  • When people talk about "the media," they often mean:?
    6·1 answer
  • Three periods after a menu item (...) mean that clicking that command will open
    15·2 answers
  • PLEASE HELPPPPPPP
    15·1 answer
  • What is a URI (include example)
    7·1 answer
  • The physical part or components of a computer system called​
    5·2 answers
  • Which support function under Tech Mahindra is governing data privacy and protection related requirements
    15·1 answer
  • PLEASE HELP ASAP!!!!!!!!!!!
    7·2 answers
  • Alexis plans to stop trading once she lose 5% of her account balance, her account balance is $215.00. How much money is she will
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!