EGR 1400 EVALUATION TEST QUESTIONS AND
ANSWERS SURE A+
✔✔the Text property - ✔✔What property of a Label control would you need to set to
change the words displayed in the Label on the form?
✔✔5 - ✔✔What is the value of choice after the code below has finished executing? The
user entered a 4 in the text box, txtNumber.
int choice; choice = int.Parse(txtNumber.Text);
if ((choice > 6) && (choice < 4))
{
choice = 5;
} choice++;
✔✔b. txtAge - ✔✔Which of the following is the best name for a text box that will hold a
person's age within a Visual Studio .NET project, keeping in mind the recommended
naming conventions?
a.
None of these
b.
txtAge
c.
Form1
d.
Age
e.
txtText1
✔✔an event - ✔✔When the user clicks a button, _________ is raised.
✔✔d. RandNum=myRand.Next(1,4); - ✔✔Which of the following statements will set
RandNum to a value between 1 and 3, inclusive?(myRand has been declared as new
Random)
, a.
RandNum = myRand.Next(1,3);
b.
RandNum = myRand.Next(0,4);
c.
RandNum = myRand.Next(0,3);
d.
RandNum = myRand.Next(1,4);
✔✔3.80 - ✔✔What is the value of float.Parse("3.8").ToString("0.00")?
✔✔400500 - ✔✔What does the following expression result in:
txtText1.Text = txtSalary.Text + txtBonus.Text + txtOvertime.Text;
Given that the values entered for txtSalary is 400, txtBonus is 50 and txtOvertime is 0
✔✔int a, b; - ✔✔declare but don't initialize the variables a and b as type Integer
✔✔18.33 - ✔✔When a=9 and b=3, what is the result of the expression:
a+b/a+b*b?
✔✔continuing - ✔✔the code below demonstrates _____ a string on a second line in the
code window
"This is a string " +
"This is the 2nd line";
✔✔temp = x;
x = y;
y = temp; - ✔✔Assume that x, y, and temp are Integer variables x = 5 and y = 8. Which
of the following lines of code swaps the values of x and y?
a.
x = temp;
x = y;
y = temp;
b.
temp = x;
x = y;
y = temp;
c.
x = y;
temp = x;
y = temp;
ANSWERS SURE A+
✔✔the Text property - ✔✔What property of a Label control would you need to set to
change the words displayed in the Label on the form?
✔✔5 - ✔✔What is the value of choice after the code below has finished executing? The
user entered a 4 in the text box, txtNumber.
int choice; choice = int.Parse(txtNumber.Text);
if ((choice > 6) && (choice < 4))
{
choice = 5;
} choice++;
✔✔b. txtAge - ✔✔Which of the following is the best name for a text box that will hold a
person's age within a Visual Studio .NET project, keeping in mind the recommended
naming conventions?
a.
None of these
b.
txtAge
c.
Form1
d.
Age
e.
txtText1
✔✔an event - ✔✔When the user clicks a button, _________ is raised.
✔✔d. RandNum=myRand.Next(1,4); - ✔✔Which of the following statements will set
RandNum to a value between 1 and 3, inclusive?(myRand has been declared as new
Random)
, a.
RandNum = myRand.Next(1,3);
b.
RandNum = myRand.Next(0,4);
c.
RandNum = myRand.Next(0,3);
d.
RandNum = myRand.Next(1,4);
✔✔3.80 - ✔✔What is the value of float.Parse("3.8").ToString("0.00")?
✔✔400500 - ✔✔What does the following expression result in:
txtText1.Text = txtSalary.Text + txtBonus.Text + txtOvertime.Text;
Given that the values entered for txtSalary is 400, txtBonus is 50 and txtOvertime is 0
✔✔int a, b; - ✔✔declare but don't initialize the variables a and b as type Integer
✔✔18.33 - ✔✔When a=9 and b=3, what is the result of the expression:
a+b/a+b*b?
✔✔continuing - ✔✔the code below demonstrates _____ a string on a second line in the
code window
"This is a string " +
"This is the 2nd line";
✔✔temp = x;
x = y;
y = temp; - ✔✔Assume that x, y, and temp are Integer variables x = 5 and y = 8. Which
of the following lines of code swaps the values of x and y?
a.
x = temp;
x = y;
y = temp;
b.
temp = x;
x = y;
y = temp;
c.
x = y;
temp = x;
y = temp;