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
You are creating a mobile version of a community discussion site for busy moms. Users post questions and other topics for discus
Anvisha [2.4K]

Answer:

<u>Create a small, collapsible navigation bar at the top of the home page so users can see new topics without scrolling</u>

Explanation:

By so doing the user experience on the website would be improved because, instead of struggling through several pages to read through discussion threads, they can simply click on the navigation bar and pick a discussion topic that interests them.

5 0
3 years ago
What can a user modify on a business card using the Edit Business card in the dialog box?​
AysviL [449]
Answer: layout,image,font,background color,
6 0
3 years ago
NOTE: in mathematics, the square root of a negative number is not real; in C therefore, passing such a value to the square root
Tanya [424]

Answer:

# include<math.h>

# include<stdlib.h>

# include<stdio.h>

int main()

{

    int choice;

    double area;

    printf("Enter the area of Square:");

    scanf("%lf", &area);

    printf("Enter the choice: 1, 2:");

    scanf("%d", &choice);

    switch(choice)

    {

        case 1:if(area<0.00)

                        {

                        printf(" INVALID");

                        break;

                        }

                      else

                        {

                        printf("side of square: %lf", sqrt(area));

                        break;

                       }

                       break;

        case 2: break;

    }

return 0;

}

Explanation:

Here, if area is less than 0 then invalid message is printed out. And if area is more than 0 then the sqrt is calculated and the side of a square length is being printed out. And that is what is required. lf is for double. And math.h is included to make use of the sqrt function.

4 0
3 years ago
6) Which of the following an OPERATING SYSTEM? a) Window 7 b) excel c) PowerPoint d) Publisher​
Anastaziya [24]

Answer: windows is an operating system

5 0
1 year ago
In scratch coding what can I do with "when I recive messeage 1 "
Ilya [14]

Answer:

Messages can be sent from other parts of your program.

The 'When receive message...' block allows you to receive those messages and start another part of your program. That way you can even have parts of you program run in parallel.

3 0
3 years ago
Other questions:
  • A __________ network is good for connecting computer clusters.
    13·2 answers
  • Cd-roms typically use the _______ filesystem type.
    11·1 answer
  • To get revenge on the pizza parlor burning his pizza and not reimbursing him for it, David returned to the pizza parlor after-ho
    9·2 answers
  • As a safe driver, you cannot, __________
    13·1 answer
  • What is a programming language?
    11·2 answers
  • I - For any two points on the Internet, there exists only one path between the two points II - Routing on the Internet is fault
    12·1 answer
  • You have created a PivotChart showing sales by quarter by sales rep. Before presenting it to management, you notice thename of a
    7·1 answer
  • I still haven't figured out how to award someone branliest will someone help me? If you explain to me how to do it i will do awa
    14·1 answer
  • Software that allows users to use and adapt it for any purpose, often allowing the public to participate in further development
    7·2 answers
  • Please help!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!