Examlex
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;
}
Toxemia
A medical condition in pregnant women characterized by high blood pressure, swelling, and protein in the urine, also known as pre-eclampsia.
Thalidomide
A drug originally marketed in the 1950s as a sedative, but later found to cause birth defects when taken by pregnant women, leading to strict controls on its use.
Kaposi's Sarcoma
A type of cancer that forms in the lining of blood and lymph vessels, often associated with weakened immune systems, like in AIDS.
Malaria
A life-threatening disease transmitted to humans through the bite of infected Anopheles mosquitoes, caused by Plasmodium parasites.
Q20: As explained in the Software Failure, the
Q27: Explain the difference between using an imported
Q28: Each time the order of a Koch
Q37: Which of the following characters does not
Q37: The linked list is superior to the
Q39: Assume that you will want to save,
Q55: Write an insertion sort method to sort
Q55: Abstract Data Types have which of the
Q57: So long as one is only accessing
Q59: A reference variable can refer to any