Examlex

Solved

How Many Times Does the Following Loop Execute

question 36

Multiple Choice

How many times does the following loop execute?
Int upperCaseLetters = 0;
String str = "abcdefgHIJKL";
Boolean found = false;
For (int i = str.length() - 1; i >= 0 && !found; i--)
{
Char ch = str.charAt(i) ;
If (Character.isUpperCase(ch) )
{
UpperCaseLetters++;
}
Else
{
Found = false;
}
}


Definitions:

Common Stock

A form of corporate equity ownership, a type of security that represents ownership in a corporation and a claim on part of the company’s profits.

Exercise Price

The specified price at which the holder of an option can buy (in the case of a call option) or sell (in the case of a put option) the underlying security or commodity.

Warrant

A financial instrument that gives the holder the right, but not the obligation, to buy a company's stock at a predetermined price before a specified date.

Trading

The act of buying, selling, or exchanging financial instruments, such as stocks, bonds, or derivatives, typically in financial markets.

Related Questions