本次美国代写是C#的一个限时测试
Sample multiple choice questions:
What would the following code return for Grade, with proper understanding of the if else if
statement, when the score of 85 is entered?
if (Score > 60)
Grade = “Passed”;
else if (Score > 70)
Grade = “Your mother still loves you”;
else if (Score > 80)
Grade = “Your parents would be proud”;
else if (Score > 90)
Grade = “Your family is proud of you”;
a. Passed
b. Your mother still loves you
c. Your parents would be proud
d. Your family is proud of you
e. None of the above
2. What is the difference in execution between the two following sections of code?
Example 1
int counter = 0;
while (counter < 10)
{
multListBox.Items.Add(counter * counter );
counter += 1;
}
Example 2
for (int counter = 0; counter <= 9; counter++)
multListBox.Items.Add(counter * counter);
a. The first example will execute one more time than the 2nd example.
b. They will both do the same thing.
c. The 1st example will result in an endless loop.
d. The 2nd example will execute one more time than the 1st example.
3. What is wrong with the following code?
int count = 0;
while (count < 10)
multListBox.Items.Add (“Good Job”);
a. The count should start at -1
b. This should be a for loop.
c. The text string Good Job should not have the ” marks around it.
d. The loop will never stop.
4. What is displayed in sumLabel after the following code segment is executed?
int total = 0;
for (int Outer = 1; Outer <= 2; Outer ++)
for (int Inner = Outer; Inner <= 2; Inner ++)
total += Outer* Inner;
sumLabel.Text = total.ToString(“N0”);
a. 16
b. 12
c. 9
d. 25
e. None of the above
5. Which of the following statements is false?
a. The text that identifies a text box should be aligned on the left in a label control.
b. An identifying label should be positioned either above or to the left of the control it
identifies.
c. Labels that identify controls should be entered using book title capitalization.
d. Labels that identify text boxes should end with a colon (:).