Question

C# 1.)Using the following declaration: int [ , ] exampleArray = {{3, 5, 6, 7}, {2,...

C#

1.)Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray.Rank);

2.)Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray[0, 2]);

3.) Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray[0, exampleArray.GetLength(0) − 2]);

4.)Using the following declaration:
int [ , ] exampleArray = {{3, 5, 6, 7}, {2, 8, 9, 22}, {1, 0, 4, 11}};
______________ would be displayed if the following output statement was executed.
WriteLine(exampleArray[0, 2 + 1] * exampleArray[0, 0]);

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)
2

2)
6

3)
5

4)
21
Add a comment
Know the answer?
Add Answer to:
C# 1.)Using the following declaration: int [ , ] exampleArray = {{3, 5, 6, 7}, {2,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 Using the following declarations and a member of the Array class, int [ ]...

    QUESTION 1 Using the following declarations and a member of the Array class, int [ ] bArray = new int [10]; int location; Using a method in the Array class, write a statement that would change the order of the elements in the bArray array. The contents of the first cell should hold what was in the last cell. The second cell should hold what was in the next to last cell. __________________________ HINT: You must write the full statement...

  • Consider the following code segment. int[]arr={1, 2, 3, 4, 5, 6, 7, 8}; for(int k=3; k<arr.length-1;...

    Consider the following code segment. int[]arr={1, 2, 3, 4, 5, 6, 7, 8}; for(int k=3; k<arr.length-1; R++ arr[k]-arr[k+1]; What are the contents of arr as a result of executing the code segment? a. {1, 2, 3, 5, 6, 7, 8, 8) b. {2, 2, 4, 5, 6, 7, 8, 8} C. {2, 4, 6, 5, 6, 7, 8,8} d. {4, 2, 4, 4, 6, 7, 8, 8) e. {6, 6, 4, 5, 6, 7, 8, 8} int) arr={7, 2.5, 3.0,...

  • in c# 1- What is the output for total after the following segment of code executes?...

    in c# 1- What is the output for total after the following segment of code executes? int num = 3, total = 0; switch (num) {                case 1:                case 2:                               total = 5;                               break;                case 3:                               total = 10;                               break;                case 4:                               total = total + 3;                               break;                case 8:                               total = total + 6;                               break;                default:                               total = total + 4;                               break; } WriteLine("The value of total is " + total); The value displayed for total would be ....

  • 1. (TCO 1) What is the output of the following C++ code? int list[5] = {0,...

    1. (TCO 1) What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 0; j < 5; j++)      cout << list[j]; (Points : 4)         0 1 2 3 4         0 5 10 15         0 5 10 15 20         5 10 15 20 Question 2.2. (TCO 1) What is stored in alpha after the following code executes? int alpha[5] = {0}; int j; for (j = 0; j...

  • Consider the following C++ program: #include <iostream> #include <cstdlib> using namespace std; int main int n...

    Consider the following C++ program: #include <iostream> #include <cstdlib> using namespace std; int main int n =0; int i = 0; cout << "Please enter a strictly positive number:"; cin >> n if (n <= 0) exit(EXIT_FAILURE) while (n > 1) n-n/2; i << endl; cout"Output:" return 0; Answer the following questions: What is the output of the program for each of the following values of n: -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9? What does...

  • Arrays C++ #include <iostream> using namespace std; int main() {       int   tests[6]; // array declaration...

    Arrays C++ #include <iostream> using namespace std; int main() {       int   tests[6]; // array declaration       int   sum = 0;       float avg;       //input test scores       cout << " Enter " << 6 << " test scores: " << endl;       for (int i = 0; i < 6; i++)       {             cout << "Enter Test " << i + 1 << ": ";             cin >> tests[i];       }       return 0; }    Type...

  • [5 marks] Using selection sort algorithm to sort the array int array[7]-5, 6, 2, 7, 9,...

    [5 marks] Using selection sort algorithm to sort the array int array[7]-5, 6, 2, 7, 9, 4, 3). Assuming we call the following function using statement selection sort (int array, 7); Please fill the table to show the changes of the array int_array after each iteration. The first column is filled. void selection_sort (int list[], int list_size) for (int i = 0; i < list size - 1; 1++) int current min = list[1]; int current_min_index-i for (int j -...

  • 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 namespace ConsoleApplication1 6...

    1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 namespace ConsoleApplication1 6 { class Program { 9 static void Main(string[] args) 10 { 11 test t = new test(10); Console.WriteLine(t. Getio); Console.WriteLine(t.J); 14 } 15 } 16 class test 17 { 18 18 private int i; 19 private int j; 20 public test(int a) 21 { 22 i = a; 23 j = a +5; public int Getio return i; } public int ) 29 30...

  • 7. What is the value of this expression: 2.5 2/4 A. 2.5 B 3.0 C. 1...

    7. What is the value of this expression: 2.5 2/4 A. 2.5 B 3.0 C. 1 D. 1.125 In the following 4 questions, assume we have the code segment below: int numberl 5 number2 10; double number3 3.0, number4 2.5 8. What is the value of the variable x1 after this statement is executed? double x1-numberl /number2: A. 0.5 B. 1 C. 0 D. 2 What is the value of the variable x2 after this statement is executed? double x2...

  • 1. What is the output of the following code segment? int array[] = { 8, 6,...

    1. What is the output of the following code segment? int array[] = { 8, 6, 9, 7, 6, 4, 4, 5, 8, 10 }; System.out.println( "Index Value" ); for ( int i = 0; i < array.length; i++ ) System.out.printf( "%d %d\n", i, array[ i ] ); 2. What is the output of the following code segment? char sentence[] = {'H', 'o', 'w', ' ', 'a', 'r', 'e', ' ', 'y', 'o', 'u' }; String output = "The sentence...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT