How many times will the following loop display "Looping again!"? for(int i=0; i<=20; i++) cout << "Looping again!" << endl;

Answers

Answer 1
Answer:

Answer:

21 times

Explanation:

Following are the description of output:

  • As it is for loop and The loop is started from the i=0 , after that check the condition 0<=20 condition is true .The control moves to the body of loop and it print Looping again! on the console window .After that it increment the value of i=i+1 .
  • Now i=1  1<=20  condition is true .The control moves to the body of loop and it print Looping again! on the console window .After that it increment the value of i=i+1 .
  • i=2 2<=20 condition is true .The control moves to the body of loop and it print Looping again! on the console window .After that it increment the value of i=i+1 .
  • ............soon
  • This process is executed again and again but when the value i=21 the loop condition is false .The loop is terminated .
  • As the loop is starts from the i=0 and executed less then equal to 20 therefore 21 times the loop is executed .

Related Questions

List two reasons why “buying a computer is no easy task” ?
Assume you have a system where you need to maintain operability even during the failing, replacing, and rebuilding of a failed disk. Thus, the data in the failed disk must be rebuilt and written to the replacement disk while the system is in operation. Which of the RAID levels yields the least amount of interference between the rebuild and ongoing disk accesses?
A device that protects electronic equipment from an increase in power, but not a decrease or outage is a ___.a. Battery backupb. Surge suppressorc. CRTd. UPS
Write a function named "read_json" that takes a JSON formatted string as a parameter and return the data represented by the input in the appropriate types for this language. For example, if the input string represents a JSON object you should return a key-value store containing the same data?
The string expression strVar.____________________ starts at index pos, replaces the next n characters of strVar with all the characters of str.

How many bits would be needed to count all of the students in class today? There are 5 children in the class.

Answers

To represent the 5 children as a computer bit, we make use of the equation 2^b = n. 3 bits are required to represent the 5 children.

Given that

n = 5 ---- number of children

The number of bits (b) is calculated as:

2^b = n

Substitute 5 for n

2^b = 5

Take logarithm of both sides

\log(2)^b = \log(5)

Apply law of logarithm

b * \log(2) = \log(5)

Make b the subject

b = (\log(5))/(\log(2))

b = 2.32

The number of bits must be an integer. So, we use the greatest integer closest to 2.32. The integer is 3

So:

b=3

Hence, the number of bits to represent the 5 children is 3.

Read more about bits at:

brainly.com/question/5046303

Broker Ray is closely acquainted with the Subdivision Heights neighborhood of his town. Over the year, Ray has made it a practice to contact homeowners in person and also to send them quarterly mailings. This method of finding listings is known as:

Answers

No multiple choice?

Caleb Co. owns a machine that had cost $42,400 with accumulated depreciation of $18,400. Caleb exchanges the machine for a newer model that has a market value of $52,000. 1. Record the exchange assuming Caleb paid $30,000 cash and the exchange has commercial substance. 2. Record the exchange assuming Caleb paid $22,000 cash and the exchange has commercial substance.

Answers

Answer: See explanation

Explanation:

1. Record the exchange assuming Caleb paid $30,000 cash and the exchange has commercial substance.

Dr Machine (new) $52000

Dr Loss on exchange of asset $2000

Dr Accumulated Depreciation $18400

Cr Equipment (Old) $42400

Cr Cash $30000

Nite that loss was calculated as:

= Market value of new machine - (Book value if old machine - Depreciation) - Cash paid

= $52000 - ($42400 - $18400) - $30000

= $52000 - $24000 - $30000

= -$2000

2. Record the exchange assuming Caleb paid $22,000 cash and the exchange has commercial substance

Dr Machine (new) $46000

Dr Accumulated Depreciation $18400

Cr Equipment (Old) $42400

Cr Cash $22000

Note that the value of the new machine was calculated as:

= Original cost + Cash paid - Accumulated Depreciation

= $42000 + $22000 - $18400

= $46000

A constructor (check all that apply): Group of answer choices will always result in a run time error and program crash if it fails to test a parameter's value for validity before assigning the parameter's value to member. This will happen the first time we run a program, and alert us to the fact that there is a problem. must use mutators to initialize class data. must use assignment statements to initialize class data. may use assignment statements to initialize class data. may use mutators to initialize class data. will receive a compiler error if it fails to test a parameter's value for validity before assigning the parameter's value to member.

Answers

Answer:

Must use mutators to initialize class data.

May use assignment statements to initialize class data.

Explanation:

These are the two characteristics that are present in constructors. A constructor is an instance method of a class or structure that creates an object of the class to which it belongs. This is mostly used in object-oriented programming. These constructors usually have the same name as the actual class, and can be used in order to set the values of the members of an object.

_________ help(s) prevent a person from being a single point of failure.

Answers

Answer:

Internet access

Explanation:

Answer:

The correct word for the blank space is: Access controls.

Explanation:

Access controls regulate who has access to sensitive information in a company. Access controls can be physical -grant access to data centers, restricted rooms or buildings- and virtual -grant access to servers, networks or certain types of files or data.

. One of the vulnerabilities the Morris worm used was a networking service called finger. The purpose of the finger service is to:A.
report which device drivers a computer uses

B.
determine which ports are open on a computer

C.
report the status of individual computer users

D.
determine which operating system is running on a computer

Answers

Answer: C)report the status of individual computer users

Explanation:Morris worm is known as the program that replicates itself automatically and hides in the computer system.Because of the vulnerability of the system ,the worm worked as finger protocol for the gaining of the user information and status.

Other option are incorrect as the they are not the vulnerability factor for the Morris worm to work on it and thus finger protocols don't work on those option.Thus, the correct answer is option(c)