O'Reilly logo

MCSD Certification Toolkit (Exam 70-483): Programming in C# by Gerry O'Brien, Vincent Varallo, Rod Stephens, Tiberiu Covaci

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix

Answers to Sample Test Questions

Chapter 1: Introducing the Programming in C# Certification

Chapter 1 has no chapter test questions.

Chapter 2: Basic Program Structure

1. You want to declare an integer variable called myVar and assign it the value 0. How can you accomplish this?
b. myVar = 0;
2. You need to make a logical comparison where two values must return true in order for your code to execute the correct statement. Which logical operator enables you to achieve this?
d. &&
3. What kind of result is returned in the condition portion of an if statement?
a. Boolean
4. What are the keywords supported in an if statement?
b. if, else, else if
5. In the following code sample, will the second if structure be evaluated?
bool condition = true;

if(condition)
   if(5 < 10)
       Console.WriteLine("5 is less than 10);
a. Yes
6. If you want to iterate over the values in an array of integers called arrNumbers to perform an action on them, which loop statement enables you to do this?
a. foreach (int number in arrNumbers){}
7. What is the purpose of break; in a switch statement?
b. It causes the code to exit the switch statement.
8. What are the four basic repetition structures in C#?
c. for, foreach, while, do-while
9. How many times will this loop execute?
int value = 0;
do
{
   Console.WriteLine (value); 
} while value > 10;
b. 1 time

Chapter 3: Working with the Type System

1. What is the maximum value you can store in an int data type?
d. 4,294,967,296 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required