IT 4400 - Final Exam Study Guide With Correct Answers |99.99% Accuracy|
A variable identifier can start with a number. A. True B. False ANS: - B Select all keywords that are reserved by C#: A. as B. get C. new D. set E. null F. var G. try H. let ANS: - A,C,E,G What is the default value of a bool value variable? A. True B. False C. null D. nil ANS: - B C# is a case-sensitive language. A. True B. False ANS: - A What is the size of long in C#? A. 16-bit B. 32-bit C. 64-bit D. Depending on CPUs ANS: - C What will be the output when the following code fragment is run? int x = 12, y = 14, z; z = y / x +7; x = z * z; System.Console.WriteLine(x); A. 0 B. 12 C. 64 D. none of the above ANS: - C What is A /= B equivalent to? A. B = B / A B. B = A / B C. A = A / B D. A = B / A ANS: - C Which of the following expressions is equivalent to the following code segment? if(g h) if(g k) Write("Brown"); A. if(g h && g k) Write("Brown"); B. if(g h && k) Write("Brown"); C. if(g h || g k) Write("Brown"); D. two of these ANS: - A To define a constant variable, which keyword should be used? A. sealed B. static C. constant D. const E. class ANS: - D Suppose A = 60 and B = 13. What is the value of A & B? A. 61 B. 43 C. 7 D. 12 ANS: - D If a programmer inserts using static System.Console; at the top of a C# program, which of the following can the programmer use as an alternative to System.Console.WriteLine("Hello");? A. System("Hello"); B. WriteLine("Hello"); C. Console.WriteLine("Hello"); D. Console("Hello"); ANS: - B Consider the code: int[] x = {5,6,7,8,9}; int[] y = x; y[2] = 3; Which of the following is correct after the above code finishes executing? A. x[2] has the value 7 B. x[2] has the value 6 C. x[2] has the value 3 D. y[3] has the value 7 ANS: - C Which of the following adds 10 to every value in a 16-element integer array named points? A. for(int sub = 0; sub 16; ++sub) points[sub] += 10; B. foreach(int sub in points) points += 10; C. both of these D. neither of these ANS: - D For the following statements, choose which of the following best describes it: int[] z = new int[5]; A. declares an array only B. declares an array and allocates space for array elements C. declares an array, allocates space for, and initializes its elements with values supplied by the user D. is incorrectly formatted ANS: - B Assume you declare a variable as int x = 100; and correctly pass it to a method with the declaration private static void IncreaseValue(int x). There is a single statement within the IncreaseValue() method: x = x + 25;. Back in the Main() method, after the method call, what is the value of x? A. 100 B. 125 C. It is impossible to tell D. The program will not run ANS: - A Which of the following pairs of method declarations represent correctly overloaded methods? A. private static void MethodA(int a) private static void MethodA(int b, double c) B. private static void MethodB(double d) private static void MethodB() C. private static double MethodC(int e) private static int MethodD(int f) D. Two of these are correctly overloaded methods.
Escuela, estudio y materia
- Institución
- Information Technology
- Grado
- Information Technology
Información del documento
- Subido en
- 25 de marzo de 2024
- Número de páginas
- 33
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
it 4400 final exam study guide
-
a variable identifier can start with a number a