CodeLab Java 1 Chapter 6 Questions and Answers 100% Correct
CodeLab Java 1 Chapter 6 Questions and Answers 100% Correct Declare and instantiate an array named scores of twenty-five elements of type int. - int[] scores = new int[25]; Write a statement that declares an array named streetAddress that contains exactly eighty elements of type char . - char[] streetAddress = new char[80]; In a single statement: declare, create and initialize an array named a of ten elements of type int with the values of the elements (starting with the first) set to 10, 20, ..., 100 respectively. - int[] a = {10,20,30,40,50,60,70,80,90,100}; Declare an array named taxRates of five elements of type double and initialize the elements (starting with the first) to the values 0.10, 0.15, 0.21, 0.28, 0.31, respectively. - double[] taxRates = {0.10, 0.15, 0.21, 0.28, 0.31}; Write a statement to declare and initialize an array named denominations that contains exactly six elements of type of int.
Document information
- Uploaded on
- April 20, 2024
- Number of pages
- 11
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers