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]
2 years ago
10

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

Computers and Technology
1 answer:
victus00 [196]2 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
You are reviewing a friend’s HTML project. You notice that the only metadata is the title. Furthermore, you ask your friend abou
docker41 [41]

Generally, the meta title is used to specify the main title of a website. The meta title is the text that is displayed in the search engine results pages, and in the tabs of a web browser. It indicates what a page is about and what it is about. You should keep it.

<em>Hope it helps :)</em>

4 0
1 year ago
A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output i
Oksi-84 [34.3K]

Answer:

Follows are the code to the given question:

def steps_to_miles(user_steps):#defining a method steps_to_miles that takes a variable user_steps

   return user_steps/2000#use return to calculate the steps

user_steps = int(input())#defining a variable user_steps that holds value from the user-end

print('%0.2f' % steps_to_miles(user_steps))#defining print that calls the steps_to_miles method

Output:

5345

2.67

Explanation:

In this code a method "steps_to_miles" that takes "user_steps" in the parameter inside the method a return keyword is used that calculates the user steps and return its values.

Outside the method, a "user_steps" variable is declared that inputs the value from the user-end pass into the method and prints its value.

3 0
3 years ago
How long will twenty percent of battery life last me?
Ghella [55]
About one or two hours.
5 0
3 years ago
Read 2 more answers
Create a stored procedure sp_Q1 that takes two country names like 'Japan' or 'USA'as two inputs and returns two independent sets
Zigmanuir [339]

Answer:

Check the explanation

Explanation:

CREATE PROCEDURE sp_Q1

<u><em>"at"</em></u>country1 NVARCHAR(15),

<u><em>"at"</em></u>country2 NVARCHAR(15)

AS

BEGIN

  BEGIN

      SELECT SupplierID, CompanyName, Phone, Country FROM suppliers

      where Country in (<u><em>"at"</em></u>country1,<u><em>"at"</em></u>country2)

     

  SELECT ProductID, ProductName, UnitPrice, SupplierID FROM Products

      where SupplierID in(

      SELECT SupplierID FROM suppliers

      where Country in (<u><em>"at"</em></u>country1,<u><em>"at"</em></u>country2)) ORDER BY SupplierID

  END

END

GO

-- Testing script.

DECLARE <u><em>"at"</em></u>RC int

DECLARE <u><em>"at"</em></u>country1 nvarchar(15)

DECLARE <u><em>"at"</em></u>country2 nvarchar(15)

-- Set parameter values here.

set <u><em>"at"</em></u>country1='UK'

set <u><em>"at"</em></u>country2='Canada'

EXECUTE <u><em>"at"</em></u>RC = [dbo].[sp_Q1]

<u><em>"at"</em></u>country1

,<u><em>"at"</em></u>country2

GO

Kindly check the attached images below to see how it looks like on a code editor.

7 0
3 years ago
Both UDP and TCP use port numbers to identify the destination entity when delivering a message. Give at least one reason for why
raketka [301]

Answer:

Follows are the solution to this question:

Explanation:

The process ID is not static because this can't be used to identity, therefore, it includes excellent service providers like HTTP since it is allocated dynamically only to process whenever a process is initiated.

Sometimes its instance connectors are managed on numerous TSAPs. This can be implemented unless the process ID is being used as each procedure could have an identity.

4 0
2 years ago
Other questions:
  • 2. a. Write pseudocode for a divide-and-conquer algorithm for finding valuesof both the largest and smallest elements in an arra
    11·1 answer
  • You are part of the team to implement new software at XYZ Inc. The employees at XYZ Inc. trust the results of the old software p
    15·1 answer
  • For some reason, Danica's classmate George could not find the registered symbol in the symbol gallery. He is selling
    14·1 answer
  • A company that manufactures machine parts orders a new system that makes products at ten times the speed of the earlier machine.
    15·1 answer
  • 6. At age 17, what was Minhaj's definition of the American Dream?
    8·1 answer
  • Explain the computer according to size​
    10·1 answer
  • You have this code in your program.
    7·1 answer
  • Explain the difference between undecidable problems and unreasonable time algorithms. Be specific.
    5·1 answer
  • Why When I change my pfp It be blurry and it be ugly- if you know what I mean :c
    15·2 answers
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!