CS 204 COMPUTER PROGRAMMING II ASSIGNMENT 01

ANNEX B2 PRODUCT ENVIRONMENTAL ATTRIBUTES COMPUTERS AND
(6030154) 5 N240(E)(M31)H NATIONAL CERTIFICATE COMPUTERISED FINANCIAL SYSTEMS N4
(IJCSIS) INTERNATIONAL JOURNAL OF COMPUTER SCIENCE AND INFORMATION SECURITY

(SAVE THIS FORM TO YOUR COMPUTER TO BEFORE BEGINNING)
1 SPECIFICATIONS FOR DESKTOP COMPUTERSM90Z PROCESSORS INTEL® CORE™
10 THE STATUTES AND REGULATIONS RELATING TO BS (COMPUTER

CS 204 - Computer Programming II

Assignment 01 - Arrays Name: _______________________________

Due Thrs 01/28/2010



  1. The ____________________ indicates the number of elements, or values, an array can hold.


  1. The size declarator must be a(n) ____________________ with a value greater than ____________________.


  1. Each element of an array is accessed and indexed by a number known as a(n) ____________________.


  1. Subscript numbering in C++ always starts at ____________________.


  1. The number inside the brackets of an array definition is the ____________________, but the number inside an array’s brackets in an assignment statement, or any other statement that works with the contents of the array, is the ____________________.


  1. C++ has no array ____________________ checking, which means you can inadvertently store data past the end of an array.


  1. Starting values for the elements of an array may be specified with a(n) ____________________ list.


  1. If a numeric array is partially initialized, the uninitialized elements will be net to ____________________.


  1. If the size declarator of an array definition is omitted, C++ counts the number of items in the ____________________ to determine how large the array should be.




  1. Look at the following array definition.


int values[12];


  1. How many elements can the array hold?

  2. What is the subscript of the first element in the array?

  3. What is the subscript of the last element in the array?

  4. If an int uses four bytes of memory, how much memory does the array use?




  1. Look at the following array definition.


int numbers[5] = { 1, 2, 3 };


  1. What value is stored in numbers[2]?

  2. What value is stored in numbers[4]?




  1. Given the following array definition:


int values[5] = { 4, 7, 6, 8, 2 };


What does the following statement display?


cout << “ “ << (values[2] + values[3]) << “ “ << values[values[4]] << endl;




  1. Answer the following questions regarding an array called fractions.


  1. Define a constant variable ARRAY_SIZE initialized to 10.

  2. Declare an array with ARRAY_SIZE elements of type float.

  3. Initialize the array elements to 0.

  4. Assign the value 1.667 to array element 9.

  5. Assign the value 3.333 to array element 10.

  6. Print array elements 6 and 9 with two digits of precision to the right of the decimal point and show the output that is actually displayed on the screen.





1504 WIS JI‑CRIMINAL 1504 1504 COMPUTER CRIME — §
16 MEMORY COMPUTER SCIENCE 240 LABORATORY 7 IN LAB
216 MALVERN HOT SPRING COUNTY LIBRARY COMPUTERINTERNET USE


Tags: assignment 01, an assignment, assignment, programming, computer