Unit Test 7 - Unit 07 Readiness Test Version B 1. The...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Unit 07 Readiness Test Version B 1. The following questions test your understanding of arrays. Please identify if the following statements are right or wrong. Explain why. 1) int a[3] = { 0, 2, 2, 3, 4} ; wrong: the array is defined to have 3 values but initializes 5 values 2) int a[ 3.0]; wrong: 3.0 is not a constant, it is a float value 3) float a[2]; wrong: the values assigned to the array are int values, not float values a[1] = 1; a[2] = 2; 2. The following questions test your understanding of initializing an array. 1) Define a float type array of size 5 and initialize it. int i; float faArray[5]; for (i=0;i<5;i++) faArray[i]=0; 2) Define a character array, and initialize it to “myarray”, which means the content of the character array will be “myarray”. char caArray[] = “myarray”; 3. Write a program to analyze 5 student’s grades. Your program needs to ask user interactively input the values of the grades and save them to an array. Find out the maximum grade, minimum grade and the average grade among the 5 students. Then
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/19/2008 for the course ME 205 taught by Professor Koen during the Spring '07 term at University of Texas at Austin.

Page1 / 4

Unit Test 7 - Unit 07 Readiness Test Version B 1. The...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online