Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6. Initializing an array is in C# a. required b. optional c. difficult d. prohib

ID: 3708385 • Letter: 6

Question

6. Initializing an array is in C# a. required b. optional c. difficult d. prohibited 7. When you declare an array of six double elements but provide no initialization values, the value of the first element is a. 0.0 b. 1.0 c. 5.0 d. unknown 8. Which of the following correctly declares an array of four integers? a.?RE [ ] ages = new int [4] {20, 30, 40, 50); b. int agesnew int] (20, 30, 40, 50); c.?ns [ ] ages = {20, 30, 40, 50); d. all of these 9. When an ages array is correctly initialized using the values 120, 30, 40, 50j, as in Question 8, then the value of ages [1] is a. b. 20 C. 30 d. undefined

Explanation / Answer

Solution 6: initialization of an array in c# is optional.

Because array initialization is default. Some times user entered the values or some times user not entered the values.

Solution 7: when you declare an array of six double element but no initialization values , the value of the first element is 0.0

Because all value access in double array by default is 0.0

Solution 8 : Initialization of array in c# all above three statement correctly implemented.

Meaning of the first statement size must be constant and number of the element must be matched.Then implicit conversion from the given element to the given array.

Meaning of the second statement element must be implicitly convertible to the element type and size must be determine the number of element.

Meaning of the third statement size must be determined the number of element only.

So above all three statement are true.

Then answer all of these is correct.

Solution 9 : when array ages initialized the values i.e.20,30,40,50.

Array index always start to 0.

So ages index 0 is 20

ages index 1 is 30

ages index 2 is 40

ages index 3 is 50

So the correct option is c

The value is 30.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote