Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Create an initializer list called scores that holds the character of letter grades: ' A ', ' B ', ' C ', ' D
1. Create an initializer list called scores that holds the character of letter grades: ' A ', ' B ', ' C ', ' D ', ' F ' \& state the length of the array. 1. Answer: 2.Create an initializer list to hold the names of 3 ice-cream flavors: vanilla, chocolate, strawberry & state the length of the array. 2. Answer: 3. Create an initializer list to hold a students' test grades: 80,93,89,95,97,100. 3. Answer: 4. State whether or not these are valid initializer list declarations/instantiations. (yeso) a) int[] nums ={1.1,1.2,1.3,1.4,1.5}; b) int[] fib ={1,1,2,3,5,8,13}; c) double[] sum ={3.0,4.0,5.0}; d) String[] names ={Mrs. Smith, Mr. Jones }; e) char[] apScores ={5,4,3,2,1}; a) f) boolean[] lightsOn = \{true, false, true }; b) c) d) e) f) 5.Given the following code and explanations, please fill in the blanks. public class Evens \{ //Create an initializer list containing the first 5 even numbers starting with 2. // Name the array evens. int first = evens [0];// What is the values of first? int last = evens [4];// What is the values of last? //Write a for loop to print the elements of evens. //Write a for loop to print the elements of evens in reverse. evens [2]=0; //Write a for loop to print the elements of evens but only what is in the even indexes //starting with index of 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started