/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Free solutions & answers for C# Programming: From Problem Analysis to Program Design Chapter 8 - (Page 1) [step by step] | 91影视

91影视

Problem 2

Which of the following array declarations would enable you to store the high and low temperatures for each day of one full week? a. int temp1Lo, temp2Lo, temp3Lo, temp4Lo, temp5Lo, temp6Lo, temp7Lo, temp1Hi, temp2Hi, temp3Hi, temp4Hi, temp5Hi, temp6Hi, temp7Hi; b. int temp [7, 2] = new int [7, 2]; c. temp int [ , ] = new temp[7, 2]; d. int [ , ] temp = new temp [7, 2]; e. int [ , ] temp = new temp [8, 3];

Problem 3

Assume a two-dimensional array called num is declared to hold four rows and seven columns.Which of the following statements correctly assigns the value 100 to the third physical column of each row? a. for(x = 0; x < 3; ++x) num [x, 2] = 100 b. for(x = 0; x < 4; ++x) num [x, 2] = 100; c. for(x = 1; x < 4; ++x) num [x, 2] = 100; d. for(x = 1; x < 5; ++x) num [x, 2] = 100; e. none of the above

Problem 4

Choose the statement that does not apply to the following declaration: double茠[ , ]茠totalCostOfItems茠=茠 茠茠茠茠{{109.95,茠169.95,茠1.50,茠89.95}{27.9, 18.6, 26.8, 98.5}}; a. declares a two-dimensional array of floating-point values b. establishes the maximum number of rows as 4 c. sets the array element totalCostOfItems [0, 1] to 169.95 d. declares an area in memory where data of double type can be stored e. all are correct

Problem 5

What value is returned by the method named result? int result(int [ , ] anArray) { int茠j茠=茠0, i = 0; for(int r = 0; r < anArray.GetLength(0); r++) for(int c = 0; c < anArray.GetLength(1); c++) if (anArray[r, c] < anArray[i, j]) { i = r; j = c; } return i; } a. the row index of the largest element of array anArray b. the value of the largest element of array anArray c. the row index of the smallest element of array anArray d. the column index of the smallest element of array anArray e. the index of the last element greater than its predecessor

Problem 7

Using the following declaration: char茠[茠,茠]茠n茠=茠{{'a',茠'b',茠'c',茠'd',茠'e'},茠 茠茠茠茠茠茠茠茠茠茠茠茠茠茠茠茠{'f',茠'g',茠'h',茠'i',茠'j'}}; What does n[1, 1] refer to? a. a b. f c. b d. g e. none of the above

Problem 11

How many components are allocated by the following statement? double [ , ] values = new double [3, 2]; a. 32 b. 3 c. 5 d. 6 e. none of the above

Problem 13

If you declare an array as int [,] anArray = new int[5, 3]; you can double the value stored in anArray [2, 1] with the statement: a. anArray [2, 1] = anArray [5, 1] * 2; b. anArray = anArray * 2; c. anArray [2, 1] *= anArray [2, 1]茠*茠2; d. anArray [2, 1] *= 2; e. none of the above

Problem 14

With the following declaration: int茠[茠,茠]茠points茠=茠 茠茠茠茠{{300,茠100,茠200,茠400,茠600},茠 茠茠茠茠茠{550,茠700,茠900,茠800,茠100}}; The statement points [1, 3] = points [1, 3] + 10; will a. replace the 300 amount with 310 and 900 with 910 b. replace the 500 amount with 510 c. replace the 900 amount with 910 d. replace the 800 amount with 810 e. none of the above

Problem 15

With the following declaration: int茠[茠,茠]茠points茠=茠 茠茠茠茠茠茠茠茠{{300,茠100,茠200,茠400,茠600}, 茠茠茠茠茠茠茠茠茠{550,茠700,茠900,茠200,茠100}}; The statement points [0, 4] = points [0, 4-2]; will a. replace the 400 amount with 2 b. replace the 300 and 600 with 2 c. replace the 600 with 200 d. result in an error e. none of the above

Problem 16

With the following declaration: int茠[茠,茠]茠points茠=茠 茠茠茠茠茠茠茠{{300,茠100,茠200,茠400,茠600}, 茠茠茠茠茠茠茠茠{550,茠700,茠900,茠200,茠100}}; The statement Console.Write(points [1, 2] + points [0, 3]); will a. display 900400 b. display 1300 c. display 鈥減oints[1, 2] + points[0, 3]鈥 d. result in an error e. none of the above

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Access millions of textbook solutions in one place

Recommended explanations on Computer Science Textbooks