COMP 202 Lecture Notes - Lecture 17: Gibberish, Jagged Array, Pariah Dog

11 views7 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

Compiler doesn"t care because you"re going from int to double (smaller to bigger), but your numbers will be truncated, so your value will be incorrect. Create an array of arrays! in our example: create a multidimensional array int[][] grades grades[][] contains a bunch of arrays, which contain a bunch of ints. If grades is an array of arrays, then the first index represents which array within grades to use. grades[0] the first array (e. g. assignment 1) grades[1] the second array (e. g. assignment 2) The second index represents a specific number within a specific array. grades[0][10] the 11th grade on assignment 1 grades[3][5] the 6th grade on assignment 4 array. length for multidimensional arrays. Grades. length means "how many elements are in the array grades" Grades is an array, where it just so happens every element is an array. This means it is asking "how many arrays are there inside of grades" (e. g. the number of assignments.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents