Examlex

Solved

Consider the Following Paint Method to Answer the Questions Below

question 31

Multiple Choice

Consider the following paint method to answer the questions below:
public void paint(Graphics page)
{
int x, y = 200;
page.setColor(Color.blue) ;
for (x = 100; x < 200; x += 20)
page.fillRect(x, y, 10, y-x) ;
}
-What will the following code do? Assume s is a String, x is an int initialized to 10, page is a Graphics object, and this is part of a paint method for an applet.
Boolean isVowel = false;
String vowels = "aeiou";
For (int j = 0; j < s.length( ) ; j++)
{
For (int k = 0; k < 5; k++)
If (s.charAt(j) == vowels.charAt(k) ) isVowel = True;
If (isVowel) page.drawString(""+s.charAt(j) , 10, 15*x++) ;
Else page.drawString(""+s.charAt(j) , 110, 15*x++) ;
IsVowel = false;
}


Definitions:

Right to Sell

The explicit permission granted to an individual or business entity to sell a particular product or service, often within a specific territory.

Asset

An asset is a resource with economic value that an individual, corporation, or country owns or controls with the expectation that it will provide future benefit.

American Option

Call or put option that can be exercised on or before the expiration date.

European Option

A type of options contract that allows the holder to exercise the option only on its expiration date.

Related Questions