Answers
The C# syntax for 'is not equal to' is ________. - CORRECT ANSWER !=
if (amount > 1000)
result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 12000? - CORRECT ANSWER 1
The equality operator in C# is ____. - CORRECT ANSWER ==
Two equal symbol characters == are used as the assignment operator. - CORRECT
ANSWER False
What will the console display after this code is executed?
string college = "NAU";
if (college = "NAU")
{
Console.WriteLine("Go Jacks!");
}
else
{
Console.WriteLine("Go Team!");
} - CORRECT ANSWER The code will produce a syntax error
if (examScore > 89)
, grade = 'A';
Console.WriteLine("Excellent");
Using the code snippet above, when does Excellent get displayed? - CORRECT
ANSWER every time the program is run
if (a > 10)
if (b > 10)
if (c > 10)
result = 1;
else
if (b > 100)
result = 2;
else
result = 3;
else
result = 4;
else
result = 5;
What is stored in result when a, b and c are equal to 200? - CORRECT ANSWER 1
The ternary operator ( ? : ) provides another way to express a simple if...else
selection statement. - CORRECT ANSWER True
The <, >, <=, and >= are called the logical operators of the language. - CORRECT
ANSWER False
An exclamation point followed by a single equal symbol (!=) represents not equal
in C#. - CORRECT ANSWER True
An interpretation of the while statement is "while the condition is true, perform
statement(s)". - CORRECT ANSWER True
int sum = 0;
int number = 1;
while (number < 100)