/*! 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 7 - (Page 1) [step by step] | 91Ó°ÊÓ

91Ó°ÊÓ

Problem 1

The value contained within the square brackets that is used to indicate the length of the array must be a(n): a. class b. double c. string d. integer e. none of the above

Problem 3

Assume an array called num is declared to store four elements.Which of the following statements correctly assigns the value 100 to each of the elements? a. for(x = 0; x < 3; ++x) num [x] = 100 b. for(x = 0; x < 4; ++x) num [x] = 100; c. for(x = 1; x < 4; ++x) num [x] = 100; d. for(x = 1; x < 5; ++x) num [x] = 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}; a. declares a one-dimensional array of floating-point values b. specifies the size of the array as five c. sets the array element totalCostOfItems [1] to 169.95 d. declares an area in memory where data of double type can be stored e. all are correct

Problem 8

An array is a list of data items that_________ . a. all have the same type b. all have different names c. all are integers d. all are originally set to null ('\0') e. none of the above

Problem 9

Using the following declaration: int [ ] x = {12, 13, 14, 15, 16, 17, 18, 19}; What does x[8] refer to? a. 19 b. 18 c. '\0' d. 0 e. none of the above

Problem 10

Which of the following adds 42 to the element at the fifth physical spot? int [ ] x = {12, 13, 14, 15, 16, 17, 18, 19}; a. x[5] += 42; b. x[4] += 42; c. x[5 + 42]; d. x = 42 + 5; e. none of the above

Problem 11

Which of the following adds 42 to the element at the fifth physical spot? int [ ] x = {12, 13, 14, 15, 16, 17, 18, 19}; a. x[5] += 42; b. x[4] += 42; c. x[5 + 42]; d. x = 42 + 5; e. none of the above

Problem 13

What output is produced by the following code? intƒi; intƒ[ƒ]ƒanArrayƒ=ƒnew intƒ[5]; forƒ(iƒ=ƒ0;ƒiƒ<ƒanArray.Length;ƒi++) ƒƒƒƒƒanArrayƒ[i]ƒ=ƒ2ƒ*ƒi; forƒ(iƒ=ƒ0;ƒiƒ<ƒanArray.Length;ƒi++) ƒƒƒƒƒConsole.Write(anArrayƒ[i]ƒ+ƒ“ƒƒ“); a. 2 2 2 2 2 b. 2 4 6 8 10 c. 0 2 4 6 8 10 d. 0 2 4 6 8 e. none of the above

Problem 19

To convert all the uppercase letters in a string to their lowercase counterpart, you can use the ________ method of the string class. a. IsLower( ) b. ConvertLower( ) c. Lower( ) d. ToLower( ) e. none of the above

Problem 21

Which method in the Array class can be used to get or set the number of elements that an ArrayList can contain? a. Length( ) b. Size( ) c. Dimension( ) d. Rank( ) e. Capacity( )

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