Tco 6 all of the elements of an array must have the

This preview shows page 21 - 24 out of 24 pages.

Question 2.Question :(TCO 6) All of the elements of an array must have the same _____.
Question 3.Question :(TCO 6) Which statement assigns the value 99 to the first element of the array declared as the following?int[] numbers = new int[5] {1,2,3,4,5};
C I S 1 1 5 Q U I Z S P a g e | 22Question 4.Question :(TCOs 5, 6, 8) What is the output of the following C# code?int x, y;x = 2;while (x < 5){y = 1;while (y < 4){Console.Write(x);y = y + 1;}Console.WriteLine();x = x + 2;}Student Answer:2 4 2 4 222444 222444
C I S 1 1 5 Q U I Z S P a g e | 23Question 5.Question :(TCOs 5, 6, 8) Write the C# code to for the following problem.Declare an array to store five values; they could be decimal numbers.Prompt the user to store values into the array.Then prompt the user for a value to subtract from each element of the array.Subtract that value from each element of the array and print the new values. Make sure you actually change the values in the array.The output should look like this (note that it should work for any values that are input, these are just examples). You must use loop(s) to process the array.Enter number: 10
C I S 1 1 5 Q U I Z S P a g e | 24}Console.Write("Please enter the value to subtract: ");value = Convert.ToInt32(Console.ReadLine());

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture