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)
Geschreven voor
- Instelling
- CMPSC 201
- Vak
- CMPSC 201
Documentinformatie
- Geüpload op
- 1 juni 2023
- Aantal pagina's
- 7
- Geschreven in
- 2022/2023
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
arrays
Ook beschikbaar in voordeelbundel