What kinds of circumstances would lead you to writing a function versus using a loop? please explain in simple terms

Answers

Answer 1

Answer:

1. You want to use parameters

2. You don't want your program to run multiple times

3. You want to call that snippet of code throughout your program

hope this helped :D


Related Questions

Why does it matter if a network is set up as a LAN, or a WAN?

Answers

Answer:

A small office or business will typically only need a LAN. The local network will ensure that different files can be transferred through your office leading to a connected business environment. If you have a larger business or multiple branches, that's when you're going to need a WAN. -Google.

Answer:

A small office or business will typically only need a LAN. The local network will ensure that different files can be transferred through your office leading to a connected business environment. If you have a larger business or multiple branches, that's when you're going to need a WA

Explanation:

choose the type of error described. can you help me bc i don’t know??

Answers

Answer:

logic error occurs when the result is wrong...

syntax error occurs when you use the wrong punctuation...

runtime error occurs when the program starts running...

Answer:

Logic error: When the computer outputs an undesirable value due to the wrong use of operations.

Syntax error: Occurs when syntax is not used correctly in code.

Zero division error: Occurs when a value is divided by zero.

Hope this helps :)

Select the best answer from the drop-down menu. Sometimes people feel threatened by new ideas and different ways of doing things. This results in . conflict is resentment that a person is experiencing but doesn't express. conflict is the behavioral or action stage of conflict. This is often characterized by negative actions. Conflict can arise in the workplace because of personality issues, cultural differences, and .

Answers

Answer

Conflict

Latent

Manifest

Religious beliefs

Explanation:

Four students measured the mass of a piece of metal whose accurate mass is 34.75g. Their results are 34.2g, 33.75g, 35.0g, and 34.69g. Explain whether the results are precise or accurate​

Answers

Answer:

The given data are more precise than they are accurate

Explanation:

From the given measurements, we have;

The accurate mass = 34.75 g

The deviations from the accurate measurement is as follows;

34.2 g - 34.75 g = -0.55 g

33.75 g - 34.75 g = -1 g

35.0 g - 34.75 g = 0.25 g

34.69 g - 34.75 g = -0.06 g

For precision measurement, we find the average deviations as follows;

The sum of the deviations = -0.55 g - 1 g + 0.25 g - 0.06 g = -1.36 g

The average deviation = -1.36 g/4 = -0.34 g

For accuracy measurement, we find the average of the absolute deviations as follows;

The sum of the absolute deviations = 0.55 g + 1 g + 0.25 g + 0.06 g = 1.86 grams

The average absolute deviation = 1.86 g/4 = 0.465 g

Therefore, the magnitude of the average deviation is less than the magnitude of the absolute deviations, therefore, the given data are more precise than they are accurate

plzz help me with this question.........

Write a program to input a number find the sum of digits and the number of digits. Display the output

sample input - 7359
sample digits - 24
number of digits - 4​

Answers

Answer:

str = input("Enter a number: ")

sum = 0

for c in str:

   sum = sum + int(c)

print("Sample input - {}".format(str))

print("Sum of digits - {}".format(sum))

print("Number of digits - {}".format(len(str)))

Explanation:

That's python. Was that what you were looking for?

Answer Using Java :-

import java.util.*;

public class Digit

{

public static void main(String args[ ] )

{

Scanner in=new Scanner (System.in)

System.out.print("Enter a number: ");

int n = in.nextInt();

int sum = 0, count = 0;

while (n!=0)

{

int d = n % 10;

sum + = d;

count++;

n /= 10;

}

System.out.println("Sum of digits=" +sum);

System.out.println("Number of digits=" +count);

}

}

write a program which calculates the difference between two integers which are entered by the user. The answer should be a positive integer regardless of the order in which the integers are entered. ​

Answers

In python 3.8:

print(abs(int(input("Enter a number: "))-int(input("Enter a number: "))))

Which scenarios are examples of students managing their time well? Check all that apply. A student studies while watching her favorite television shows. A student sets aside time to study every afternoon at his desk. O A student writes down some goals that she hopes to achieve in school. A student drafts a study schedule that includes breaks. A student uses her desk calendar to record the due dates for her homework assignments. O A student rushes through his homework while sending text messages to friends. 3). Intro​

Answers

Answer:

b,c,d, and e

Explanation:

Hope this helps

Answer:

BCDE

Explanation:

EDG 2021

Which sentence best describes how block-based code works?

Answers

Answer:

Block-based code is a simpler way to code.  

Explanation:

Block-based coding is a form of programming language where the developer issues instructions by dragging and dropping blocks.

PLS HELP BEING TIMED!!!
Complete the following sentence.
The basics of managing money such as balancing a checkbook and making a budget are _____
skills

Answers

Answer:

Bank Rate skills

Explanation:

because it is i believe

Sharing contacts is different from sharing a calendar. Use the drop-down menus to explain how.
1. You can share contacts with
outside the organization without publishing online.
2. You are not able to that somebody share their contacts with you.
3. Both calendars and contacts are shared in emails. For the latter, the recipient clicks
and selects from a list.

Answers

Answer:

anyone

request

open shared contacts

Explanation:

edge 2020

Answer:

anyone

request

open shared contacts

Explanation:

help me i dont understand REAL ANSWERS PLS

Answers

Answer:

it's answer is B

hope it helps you

what is wrong with this picture?????

Answers

“you got a tight little-“

uhm y’know everything is wrong with it terrifying really is uhm but yeah.

oh god that leg tho

please help, thank you

Answers

Answer:

radish spinach swiss chard

Explanation:

radish, swiss Chard, spinach

What are specific and relevant terms that will help you locate information using an internet search engine?

A: Keywords

B: Search Words

C: Smart Words

D: Unusual Words

please help me!!​

Answers

I would say A:keywords

Hope this helps

I’m sorry if this is wrong

Have a great day/night

Answer:

keyword

Explanation:

i got it right

Nadia's productivity at work is being hurt due to the large quantity of unwanted e-mail she receives. What steps can she take to reduce the amount of e-mail she receives?

Carefully read and complete subscription forms.

Read e-mail messages every hour.

Stop using the Internet.

Forward spam to spam at uce.gov.

Stop posting her e-mail address on newsgroups.

Answers

Answer:

I think that carefully reading and completing subscription forms is important and could possibly lower the amount of emails.

Reading them every hour will only hurt her work ethic.

Stop using the internet won't help at all.

Forwarding the spam to spam at uce.gov could work because that's what the site was made to do.

Stop posting her e-mail address on newsgroups could definitely help.

I'm stuck between the 1st, 4th, and 5th one but its one of them.

How many answer choices are you allowed?

It is steps plural.

Answer:2,3,5

Explanation:

Can you please help me with the AP Computer Science Fill in the blank. What goes on number 5 8 and 18. I don’t understand this I need help programming.

Answers

Answer:

you can probably just delete them. what programming language is this?

state the functions of all the parts of the computer​

Answers

Answer:

Parts of a computer with their functions

The computer case. This is the part that holds all of the internal components to make up the computer itself. ...

Motherboard. ...

CPU: Central Processing Unit. ...

RAM: Random Access Memory. ...

Graphics Card. ...

Sound Card. ...

Hard Drive. ...

SSD: Solid State Drive.

Explanation:

Which of the following identifies the most appropriate courses to take in high school for someone interested in becoming a mechanical engineer?
drafting- and math-related courses
math- and science-related courses
computer- and design-related courses
science- and computer-related courses

Answers

Answer: New questions in Health

Which member of the multidisciplinary team would help a patient improve his flexibility in the joints after a knee-replacement surgery? A. a physiot…

What are two advantages of a multidisciplinary team approach? better diagnosis in complex cases shared responsibility for decisions more opportunit…

MARKING PEOPLE AS BRAINLIST PLEASEEE HELP Where is the carbon dioxide picked up and the oxygen unloaded in the body? A:Arteries B:Veins C:Capillar…

Which healthcare professional would be primarily responsible for treating a patient for his anxiety disorder after a surgery? A. a nurse B. a nutr…

Do Now: What might be a situation where it might be important to identify 3 points somebody? What are different strategies that scientists could use …

Explanation:

it was field day for the upper grades at Rock Creek School,
Each grade had to choose a team name and a color for their tee-shirts,
Use the clues below to figure out what each grade chose for their team name and tee-shirt color, each grade can chose one color and one team name.

- The third and fifth grades didn't choose an animal for their team name.

-The forth grade ended up with red tee-shirts with sharks on the.

-The fifth graders and tornadoes are not wearing teal.

-The bears are wearing green.

​​

Answers

Answer:

its c

Explanation:

Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'. I am stuck on this python assignment. Don't need the answer asap, just some explaining of how to write code to do that. I know about the built in sort function

Answers

Answer:

Read the file and save it to a variable as a string, split the string variable and cast it to a set object using the set function to get the unique words in the file. Then use the max function with the key attribute to use regular expression module "re" to compare the first letter of each item to return in a list comprehension or append to a list.

Explanation:

The open function is used to import a file in python, the split string method splits the string to a list of items and the set function removes any duplicates of a word or item.

Using the for loop statement, iterate over the items and compare and return the items in alphabetical order with the 're' search method getting the item with uppercase letters with higher precedence than lowercase.

what is multimedia computer system​

Answers

A Multimedia can be defined as any application that combines text with graphics, animation, audio, video, and/or virtual reality. Multimedia systems are used for security to keep intruders out of a system and for the protection of stored documents

help plz i need help ASAP
bhgydhusjbhhuidjs

Answers

Answer:

id.k

Explanation:

good luck

i need help, thank you

Answers

Answer:

uhh yes?

Explanation:

i think people can go on weeks without food, so a set of trays wit food should last them a day

Ohhh I’m here and I also say yes one set can be enough if used wisely

Which graph or chart shows changes in the value of data?

a
Bar graph

b
Column chart

c
Line graph

d
Pie chart

Answers

Answer:

Bar graph and Pie chart

Answer:

C And D

Explanation:

edge2020 users

Debugging is finding and fixing problems in an algorithm or program. True
or False.
False
True

Answers

The correct answer is True

Debugging is finding and fixing problems in an algorithm or program is True statement.

Debugging is indeed the process of finding and fixing problems, errors, or bugs in an algorithm or computer program.

When a program does not produce the expected output or behaves unexpectedly, programmers use debugging techniques to identify and resolve the issues.

This involves analyzing the code, checking for syntax errors, logical errors, and unexpected behavior, and making the necessary corrections to ensure the program functions correctly.

Thus, the given statement is True.

Learn more about Debugging here:

https://brainly.com/question/9433559

#SPJ6

How do I create a videogame

Answers

Answer:

-Learn how to code

-Make Character

-Design

-Go to classes

-Go on video game platforms and make an video game(rblx is the best in my opinion)

-Play video games and see the scripts

-Decide what type of video game your making(horror, family game, battle game, etc.)

Explanation:

Answer:

By using programming languages such as Lua And JavaScript because they are the best for programming videogames

I'm working on an assignment for my computer science class (Edhesive) and when I run the code, there are no errors. But when I try to check it, it comes up with a Traceback error.

My code:

b = float(input("Enter Temperature: "))

Traceback (most recent call last):
File "./prog.py", line 7, in
EOFError: EOF when reading a line

Answers

Answer:

The error is because you wrapped the input in float. First record the input and then modify it.

Explanation:

b =  input("enter temp:")

b = float(b)

How can internet affect business area? 


Answers

The communication between customers and businesses increases customer satisfaction and businesses are able to connect to the customers. it lets businesses go further to expand their service or product which can increases profit.

how are web design & web development different from each other?

Answers

Answer:

Developers are people who build a website's core structure using coding languages, while designers are more visually creative and user-focused. Developers use their programming knowledge to breathe life into the designer’s creative vision.

You could think of developers as construction workers, and web designers as architects – both necessary, but different, skill sets.

I hope this helped :D

Explanation:

What device is required to connect to the Internet?
O Wi-Fi
O an ISP
a router
a modem​

Answers

Answer:

modem

Explanation:

The primary piece of hardware you need is a modem. The type of Internet access you choose will determine the type of modem you need. Dial-up access uses a telephone modem, DSL service uses a DSL modem, cable access uses a cable modem, and satellite service uses a satellite adapter.

Answer:

D

Explanation:

Edg 2021

Other Questions
Sally's job pays her $30 per hour.If Sally works 6 hours, how much money would she earn?I The stronger the commitment to a community, the less likely people are to engage in deviant behavior. Please select the best answer from the choices provided T F According to The Flash, The heroes top speed is Mach 3.3, or 2,500 miles per hour. Howlong would it take for him to run around the planet? (circumference of the earth isroughly 25,000 miles) * Find the slope and y-intercept of the graph of the equation.y = 9x + 7 Question 92 PointsWHEN THE BUDDHA FOUND ENLIGHTENMENT, HE WAS MEDITATING WHERE?DIN A TEMPLEB NEAR A BUSHEUNDER AN APPLE TREEEDUNDER A FIG TREELast Soved 9:1 3.Salem bought a car for AED 60000 and spent AED5000 on its accessories .Later he sold the car for AED 70000. Find his profit % or loss% People have looked at the night sky throughout history. In fact, ancient sailors used the stars as a tool. For example, Polaris, or the North Star, has historically been a useful compass because it is always in the northern sky. At first, people used their eyes to study the stars. Eventually, telescopes were invented. One famous astronomer, Galileo Galilei, made a telescope that was similar to the ones we use today. He used it to prove that Earth revolved around the sun. Astronomers since have made many discoveries with more powerful telescopes. What information can the reader gain from the text feature that is not discussed in the exerpt?Question 2 options:Venus and Jupiter are small in size.Planets are moons are big in size.The Moon can be a round shape.The Moon can be crescentshaped Bart thinks mice exposed to microwaves will get stronger (maybe he's been reading too much Radioactive Man). You decide to perform this experiment by placing 10 mice in a microwave for 10 seconds. He compared these 10 mice to 10 other mice that had not been exposed. His test consisted of a heavy block of wood that blocked the mouse's food. found that 8 out of 10 of the microwave mice were able to push the block. 7 out of 10 of the mice without microwaves were able to do the same.identify1. control group2. independent variable3. dependent variable4. what are some of the mentioned control variables? 5. what should bart's conclusion be? There is tears for his love, joy for his fortune, honor for his valor, and death for his ambition. Who is here so base that would be a bondman? If any, speak, for him have I offended. Who is here so rude that would not be a Roman? If any, speak, for him I have offended! What describes the structure of the excerpt above best? Are the triangles congruent? and why? I need help with my math problem.. Which statement BEST describes how the purpose of the Freedmen's Bureau differed from the purpose of the Klu Klux Klan?A It was designed to assist slaves after the Civil War.B It was designed to assist slaves and poor white people after the Civil War.C It was designed to provide land and voting rights to all freed slaves.D It was designed to protect slaves from the violence of Ku Klux Klan members. Give one example where friction is useful. Can someone feed me with correct answer pls c: Select the adjective in the sentence.The chubby baby clapped his hands excitedly. help real quick on this plzz A particle starts from rest and moves with a constant acceleration. It travels the first 16 m in 4 s.The time (in second) at which the velocity of the particle becomes. 8. m/s is:a) 3b) 4c) 5d) 6e) 7 Select the correct answer.Select an approach that actors will use to perform successful improv theater.OAAn actor uses emotional memory to emote on screen..An actor will use As-if exercises to explore the character.OC. Actors will use relevant, smart, and funny material to deliver spontaneous performances.OD. Actors will use truthfulness, imagination, and instinct to deliver a role. Sharad went to his friend's place on a motorcycle. When he started, the reading was 19,235 km. When he reached his friend's place it was 19,301 km. How many km did sharad travel ? Write an original essay explaining your view of the Missouri CompromiseThe problem with compromises is that no one gets their way. This leads to future conflicts. Explain why this statement may or may not be true of the Missouri Compromise. Some things to think about are the advantages and disadvantages of the compromise. Decide whether compromises are necessary in a democratic republic. Explain the reasons for your opinion. State your conclusions in a 500 word essay using proper grammar, spelling, and punctuation.can someone please help fast ???? PLZZ HELPPPWhat four protections are found in the 6h Amendment: