A+)
The escape character (\) is used to insert special characters into an output string
A.) True
B.) False - Answers A.) True
Brute force is a good approach to programming
A.) True
B.) False - Answers B.) False
Which of these is not a property of a good algorithm?
A.) Unambiguous
B.) Complete
C.) Precise
D.) Complex - Answers D.) Complex
What type of error is present in the underlined C# code sample below?
public static void Main(string[] args)
{
Console.WriteLine("Enter a number");
int num = Convert.ToInt32(Console.ReadLine());
int squared = num + num; ⬅️
Console.WriteLine(num + " squared is " + squared);
}
,A.) Syntax Error
B.) Runtime Error
C.) Compilation Error
D.) Logic Error - Answers D.) Logic Error
Evaluate as an integer: 8 - 3 * + 2 (Remember PEMDAS)
A.) 18
B.) 8
C.) 4
D.) 24 - Answers C.) 4
Evaluate as an integer: 5 % 7 + 3 * 2 + 4
A.) 7
B.) 32
C.) 12
D.) 15 - Answers D.) 15
In the equation 2 + * 2, the division operation / is evaluated first.
A.) True
B.) False - Answers A.) True
In the equation 2 + * 2, the addition operation + is evaluated first.
A.) True
B.) False - Answers B.) False
, In the equation 2 + 8 /4 * 2, the multiplication operation * is evaluated first.
A.) True
B.) False - Answers B. False
Logical operations are evaluated before comparison / relational operators.
A.) True
B.) False - Answers B.) False
When assigning a value to a variable, the variable must be on the left of the assignment operator (=).
A.) True
B.) False - Answers A.) True
Literals (boolean, int, double) are values that are entered directly into the code.
A.) True
B.) False - Answers A.) True
What is the value of the variable remainder in the following equation?
long remainder = 3 % 6;
A.) 6
B.) 3
C.) 0
D.) 0.5 - Answers B.) 3
What is the value of the variable divisor in the following equation?
long remainder = 3 % 6;