DeVry COMP 122 Week 6 Homework Latest



DeVry COMP 122 Week 6 Homework Latest

Week 6 Homework

Complete the following problems.

  1. 1.Write C statements to do the following:
  2. a.Declare an array alpha of 15 components of type int.
  3. b.Output the value of the 10thcomponent of the alpha array.
  4. c.Set the value of the 5thcomponent of the alpha array to 35.
  5. d.Set the value of the 9thcomponent of the alpha array to the sum of the 6th and 13th components of the alpha array.
  6. e.Set the value of the 4thcomponent of the alpha array to three times the value of the 8th component minus 57.
  7. f.Output alpha so that five components appear on each line.
  8. 2.What is stored in the list array after the following code executes?

int list[5];

for(int j = 0; j < 5; j )


list[j] = 2 * j 5;

if (j % 2 == 0)

list[j] = list[j] – 3;


  1. 3.What does array index out of bounds mean? What can happen if this occurs in your program?
  2. 4.Write C statements to define and initialize the following arrays using appropriate data types:
  3. a.An array of heights has 6 components which have the following values: 5.5, 5.8, 6.3, 6.6, 4.9, 5.9.
  4. b.An array of weights has 4 components which have the values: 140, 165, 190, 207.
  5. c.An array of symbols which contains the following characters: ‘$’, ‘%’, ‘@’, ‘!’, ‘|’, ‘&’.
  6. d.An array of the seasons which contains “Spring”, “Summer”, “Fall”, “Winter”.
  7. 5.Given the following declaration, what is stored in the 8thelement of the array?

int list[10] = {1, 2, 3, 4, 5};

  1. 6.When an array is passed as an actual parameter to a function, what is really being passed in to the function? Why are arrays passed this way?
  2. 7.Write a for loop to initialize the following array (int data[10]) with the values 10, 9, 8… 1.
  3. 8.Given an array of 10 doubles named data, write a loop that loads the array with user input.
  4. 9.Given an array of 100 doubles named data, write a loop that creates the sum of all the array elements.
  5. 10.Write a loop that finds the smallest element in an integer array called data containing 100 elements.


DeVry Courses helps in providing the best essay writing service. If you need 100% original papers for DeVry COMP 122 Week 6 Homework Latest, then contact us through call or live chat.

DeVry COMP 122 Week 6 Homework Latest

Best DeVry COMP 122 Week 6 Homework Latest
DeVry COMP 122 Week 6 Homework Latest


There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Back to Top