CMPSC 201: FINAL (NEW MATERIAL) A+ Graded.
arrays correct answers used to store a collection of related values array declaration format correct answers data type arrayName[n]; (n is the max number of values (elements) that you want to store) for arrays they start at index ___ correct answers 0 all elements in an array must have the same ___ correct answers data types/represent similar data for arrays you do not have to use all the elements of the array (T/F) correct answers true array size correct answers refers to the number of elements containing data array capacity correct answers the maximum size of the array array elements ___ be initialized at time of the declaration correct answers can double temp[4] = {2.3, 3.4, 5.0, 4.5}; (do not need the [4]) ___ have the size be larger than how many are initialized in an array correct answers can c-strings correct answers are arrays of characters c-string should allow room for ___ correct answers null characters char name[6] = "Harry"; parallel arrays correct answers use if you want to store data that is related, but different types resistance, voltage, current resist[n] = volt[n] / current[n] ___ use single array elements in functions correct answers can x[n] = cos(angle[n]); can use entire arrays in functions (T/F) correct answers true (use just the name) //heading void printArray(double numarray[ ], int size)
Written for
- Institution
- CMPSC 201
- Course
- CMPSC 201
Document information
- Uploaded on
- June 1, 2023
- Number of pages
- 7
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
Also available in package deal