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
MatroZZZ [7]
3 years ago
14

The difference between a for loop and a while loop is that a for loop is a loop that happens for a certain number of times. A wh

ile loop happens until a certain condition is met. How do you know when to use each one? Give specific examples in your answer.
Computers and Technology
1 answer:
Shalnov [3]3 years ago
4 0

For loop, if you have to fill water in a bucket three times, It will fill water in a bucket three times. While loop, If you have to take water from the well multiple times but stop when the water is empty in the well.

Explanation:

  • For loop is used mostly static way of programming.
  • While loop is used for dynamic approach of programming.
  • Static approach has fix number of times the task is done.
  • Dynamic approach is conditional attempt to complete the entire task.
  • For loop uses discrete which means it uses the count approach.
  • While loop is basis on characteristic, It works mostly with alphabet.
  • Functions play major role in while loop to take a dynamic approach.
You might be interested in
Use rounding to decide if the answer is reasonable. Write
erik [133]

Answer:

348 + 395 = 743

Hence, together they have 743 pennies and not 653 pennies. And we cannot perform the rounding, as that is the case when we have the decimal number or the float number. Only then we have the digits after the decimal. And if it's more than 5, we add 1 to the previous or else leave the number as it is. And we go on performing from right to left, and till the number of decimal places, we need to round off. However, here its purely an integer, and hence we cannot round off, as that will result in a significant loss, and which is not acceptable. However, if we want to round off before decimal places as well, then in that case 743 will be $7s, and 653 pennies will be 6+1= $7s, and if this level of loss is acceptable then we can assume that they have the same sum of money. However, here the answer is given in pennies, and hence this is not the case. And hence the answer given in the question is not correct.

Explanation:

The answer is self-explanatory. And since both are numbers, rounding is not required(as explained in the answer section), as it is required in case of decimal and float(as explained in the answer section). And as explained in the answer section, if we can tolerate very heavy loss, then the numbers as well can be rounded off as explained in the answer section. But that is not the case here, as the answer is given in pennies.

6 0
4 years ago
What does %d, , %c, %s mean and what's their difference?
Leviafan [203]
Not sure in what environment your asking for, but in C programming, %d is an integer (basically a number), %c is a character, that is a single alphanumeric character, where as %s is a series of alphanumeric characters, in programming %s is actually just an array of characters (so multiple %c), but don't worry about that to much. 

Examples in c. 

int number = 1;
char character = "c"; (numbers (integers) can be characters)
char string[5] = "abcd"; ([5] implies 5 characters, here there are 4, that is because an invisible character exists known as a "null terminator" (\0).
6 0
3 years ago
Read 2 more answers
Google Docs, MS Word, Google Slides, MS PowerPoint, Google Sheets, MS Excel In your opinion which software in each category is e
podryga [215]

Answer:

I my opinion Google software is easier to use.

Explanation:

It is more upgraded and it's basically like kind of the latest version of Microsoft Software

This is just my opinion, I use Google Applications for every single thing in  my life

7 0
3 years ago
Read 2 more answers
Compare the two types of formatting that IDE devices must go through. What is the primary difference between the two?
Andrei [34K]
A quick format<span> changes the file system while the </span>full format<span> also checks the </span>drive for bad sectors.  <span>The scan for bad sectors is the reason why the Full </span>format<span> takes twice as long as the </span>Quick format<span>. If you choose the </span>Quick format<span> option, the </span>format<span> removes address files from the partition, but does not scan the disk for bad sectors.</span>
7 0
3 years ago
Read 2 more answers
NEED HELP NOW 12 POINTS!!!!!!
vlada-n [284]
The first one seems the most relivant
4 0
3 years ago
Read 2 more answers
Other questions:
  • In steps<br> Urgent please
    14·1 answer
  • Materials such as copper, silver, and aluminum through which electric energy passes freely are called
    13·1 answer
  • If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statem
    7·1 answer
  • arlos, an algebra teacher, is creating a series of PowerPoint presentations to use during class lectures. After writing, formatt
    12·2 answers
  • Which of the following statements about certificates is true?
    14·2 answers
  • 9. If you want to change the Header text of any Form then which property will you use
    10·1 answer
  • A customer in a store is purchasing five items. Write a program that asks for the price of each item, and then displays the subt
    8·1 answer
  • You can enter the following things in cells
    10·1 answer
  • What dod instruction implements the dod cui program
    14·1 answer
  • Amber is a hacker who steals information when people enter their personal details on specific websites. She intercepts the publi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!