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
mash [69]
3 years ago
10

What are Loop Errors? Describe briefly. What aresymptoms of Loop Errors?

Computers and Technology
1 answer:
victus00 [196]3 years ago
4 0

Answer:

The errors in the loop condition such that it is not giving desired results or it is not running accordingly.There are different types of loop errors which are as following:-

1.Infinite loop:-When the is not able to stop then the error is called infinite loop. for ex:-

int i=1;

while(i!=0)

{

cout<<"I am King"<<endl;

i++;

}

2.Off by one error:-This error mostly happens in loop for arrays as indexing of the array is from 0 to size-1 .So looping over the array up to the size is a off by one error.

3.Equality v/s assignment operator error:-In this error the condition in the loop is like this d=f which is wrong since = is assignment operator it assigns the value of f to d while d==f checks that the value of d and f are equal or not.

4.&& v/s || loop error:- In this error we use and operator (&&) instead of or operator (||) and vice versa.

symptoms of loop errors are not the desired output.

You might be interested in
How dependent are we on technology? ​
rusak2 [61]

very independent  : ) we use it for everything

3 0
3 years ago
Read 2 more answers
PLEASE HURRY!!<br> Look at the image below
levacccp [35]
Answer is power and base

Explanation: both power and base are number variables
8 0
3 years ago
3.14 LAB: Input and formatted output: Caffeine levels A half-life is the amount of time it takes for a substance or entity to fa
nata0808 [166]

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

double caffeineMg;

cin>>caffeineMg;

cout<<"After 6 hours: "<<fixed<<setprecision(2)<<caffeineMg/2.0<<" mg\n";

cout<<"After 12 hours: "<<fixed<<setprecision(2)<<caffeineMg/4.0<<" mg\n";

cout<<"After 24 hours: "<<fixed<<setprecision(2)<<caffeineMg/8.0<<" mg\n";

return 0;

}

Explanation:

  • Declare a variable for caffeine and take the input from user.  
  • Print the results by dividing the caffeine by relevant Half Life.
  • Use setprecision function to display the result up to 2 decimal places.
8 0
3 years ago
The more employees can do, the less they have to be managed by supervisors.
zheka24 [161]
False
Don’t take me too seriously cause I could be wrong, but I think it’s false. Unless the employees are like the best hardworking employees, they will likely slack off the second they get the chance. The more they can do just means that they can do more, it doesn’t necessary mean they need less supervision
4 0
3 years ago
Read 2 more answers
Write a program that reads a list of words. Then, the program outputs those words and their frequencies. If the input is 5 hey h
zysi [14]

Answer:

/ declare the necessary header files.

#include <iostream>

#include <string>

#include <vector>

using namespace std;

// declare the main function.

int main()

{

// declare a vector.

vector<string> words;

vector<int> counts;

// declare variables.

int size;

string str;

cin >> size;

// start the for loop.

for(int i = 0; i < size; ++i)

{

// input string.

cin >> str;

words.push_back(str);

}

// start the for loop.

for(int i = 0; i < size; ++i)

{

int count = 0;

// start the for loop.

for(int j = 0; j < words.size(); ++j)

{

// check the condition.

if(words[j] == words[i])

{

count++;

}

}

counts.push_back(count);

}

// start the for loop.

for(int i = 0; i < size; ++i)

{

// display result on console.

cout << words[i] << "\t" << counts[i] << endl;

}

return 0;

}

Explanation:

4 0
3 years ago
Other questions:
  • The /tmp directory is a temporary directory and will not exist on a system at all times. True or False?
    15·1 answer
  • What kind of firewall can block designated types of traffic based on application data contained within packets?
    7·1 answer
  • Which of the following consists of electronic components that store instructions?
    10·1 answer
  • What phrase indicates someone has knowledge and understanding of computer,internet,mobile devices and related technologies?
    6·1 answer
  • Can some please help me learn how to make a program via Binary Code?
    7·1 answer
  • Write a function named firstLast2 that takes as input an array of integers and an integer that specifies how many entries are in
    14·1 answer
  • What are copyright laws? Authority to reprint an original work as long as it's not for profit Entitlement to use and sell anothe
    15·2 answers
  • Which symbol is at the beginning and end of a multiline comment block? &amp;&amp;&amp; """ %%% ###
    5·1 answer
  • Why does my inbox keep getting notifications and then disappearing?
    15·2 answers
  • What does the following code print? time_of_day = ["morning", "afternoon", "evening"] for word in time_of_day: print "Good " + w
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!