a)Declareandinstantiate an array named scores oftwenty-five elements of type int. (b)Write a statementthatdeclares anarray namedstreetAddressthat containsexactly eighty elements of typechar....





a) Declare and instantiate an array named scores of twenty-five elements of type int.


(b)Write a statement that declares an array namedstreetAddress that contains exactly eighty elements of typechar.



2. In a single statement: declare, create and initialize an arraynamed a of ten elements of type int with the values of the elements (starting with the first) set to 10, 20,..., 100 respectively.


3. Declare an array reference variable, week, and initialize it to an array containing the strings "mon", "tue", "wed", "thu", "fri", "sat", "sun" (in that order).


4. printArray is a method that accepts one argument, an arrayof int. The method prints the contents of the array; it does not return a value. inventory is an array of int that has been already declared and filled with values. Write a statementthat prints the contents of the array inventory by calling the method printArray using a declared and instantiated object named obj.


5. Write the definition of a method printArray, which has one parameter, an array of int . The method does not return a value. The method prints out each element of the array, on a line by itself, in the order the elements appear in the array, and does not print anything else.


6. Write a method definition named makeString that will accept a variable parameter list of characters and return them as a single string.


7. Declare a two dimensional array named ticTacToe with the appropriate type and size.


8. Assign a default value (any value you like based on the correct type you used in question 8) to each element of the ticTacToe array declared in question 8, using a nested forloop.


9. Define a method that accomplish question 8. The method is named fillInTwoDimArray, and returns nothing but accepts a two-dimensional array.


10. Change the values of the following empty cells to x’s or o’s (Does not matter which) based on your answer to question 7.

























X






O






O









X






X









X





Nov 11, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here