Assume that txtAge is a TextBox control and that the user has entered the value 27 into this TextBox. Determine the action performed by the following code:

What will be an ideal response?


This code prints text when an age is inputted into the txtAge TextBox. In this case,
the statement txtAge.Text = "Young adult"; executes, because the value of intAge is less than 30, but not less than 20. The complete code reads:

```
int intAge;
intAge = Int32.Parse( txtAge.Text );
if ( intAge < 0 )
{
txtAge.Text = "Enter a value greater than or equal to zero.”;
}
else if ( intAge < 13 )
{
txtAge.Text = "Child";
}
else if ( intAge < 20 )
{
txtAge.Text = "Teenager";
}
else if ( intAge < 30 )
{
txtAge.Text = "Young adult";
}
else if ( intAge < 65 )
{
txtAge.Text = "Adult";
}
else
{
txtAge.Text = "Senior Citizen";
}
```

Computer Science & Information Technology

You might also like to view...

An action that takes place while a program is running is a(n) __________.

a. event source b. event handler c. event d. event object

Computer Science & Information Technology

Case-Based Critical Thinking QuestionsCase 10-1Training unlimited is planning to create a page that will allow users to e-mail their requests for the training videos to add to their online training offerings. What should the Web designers worry about when  making such a form?

A. browser versions B. e-mail harvesters C. spammers D. all of the above

Computer Science & Information Technology

A disc image, as defined by the International Organization for Standardization, uses what file extension?

A. .iso B. .img C. .disc D. .cd

Computer Science & Information Technology

Which of the following is NOT part of the Edit Photo Album dialog box?

A) Sharpness B) Preview C) Rotate D) Contrast

Computer Science & Information Technology