1. Given the code below, what is the output? string student1 = \"Student\"; stri
ID: 3915434 • Letter: 1
Question
1. Given the code below, what is the output?
string student1 = "Student";
string student2 = "Student";
if(student1 == student2)
{
Console.WriteLine("True");
}
else
{
Console.WriteLine("False");
}
2. You want to create an array that holds exams for students. You have 30 students, and each student takes six exams. You will store students in the first dimension and exam scores in the second dimension. How would you set the fifth score for the second student?
int[2][5] = 95;
3. Multidimensional arrays in C# are often called an "array of arrays."
4. The code below declares a jagged array.
int[][] jaggedArray = new int[2][];
jaggedArray[0] = new int[20];
jaggedArray[1] = new int[10];
5. When declaring a multidimensional array, all dimensions must have the same type.
6. When declaring a jagged array, all dimensions must have the same type.
7. You want to create a multidimensional array that holds exams for students. You have 10 students, and each student takes four exams. How would you declare the multidimensional array to store this data?
8. Strings in C# are immutable.
False
9. Given the code below, what is the output?
string student = " Student";
Console.WriteLine(student.Length)
10. When you declare a two-dimensional array, you place two numbers within square brackets. What does the first number represent?
True FalseExplanation / Answer
1) True
As two strings are equal
2) int[1,4] = 95;
3)False
Jagged arrays in C# are often called an "array of arrays." :
4)
5)
When declaring a multidimensional array, all dimensions must have the same type. : TRUE
6) When declaring a jagged array, all dimensions must have the same type : TRUE
7) int[,] examArray = new int[10,4];
8)Strings in C# are immutable. : true
9) 7
10)Row
Thanks, PLEASE UPVOTE if helpful
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.