northeastern illinois universityhomepages.neiu.edu/~faporps/2020spring/cs200/conc… · web...
TRANSCRIPT
![Page 1: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/1.jpg)
Concept Guide: ArraysCourse: CS 200Introduction to Java Programming, Comprehensive Version, 11th ed. Text Chapters: 7 Single Dimensional Arrays, 8 Multidimensional Arrays
Concept/Topic: Text Notes: Lecture Notes:What is an array?
PrimitiveData Types:StorageSpace(a review)
What is actually stored in an array reference?
How is the array stored in memory?
![Page 2: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/2.jpg)
Declaration
Instantiation
Initialization
Algorithm for user defined array sizes
![Page 3: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/3.jpg)
What are subscripts?
Allowed subscript values:(Why only these?)
subscript range
![Page 4: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/4.jpg)
What is a partially filled array?
Why would you need a partially filled array?
Algorithm for using a partially filled array
![Page 5: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/5.jpg)
Array BoundsChecking
Lab Time! Work as a team, but run with 2 sets of input- use Week 12:Lab Doc 01 Problem: Create a program to determine your quiz score averagePseudocode solution is listed in Lab Doc 01: Create (declare & instantiate) an int array of size 10 called: quizScores. Initialize the first 7 values to your quiz scores thus far in this course from user keyboard input with a “do-while loop”, sentinel value (-1),and counter to keep track of how many values you have assigned to the array.Next, use the counter from the loop above to run a “for loop” to sum your quiz scores.Then, find the average score of your quizzes thus far using the sum divided by the counter.
Lab Time! See this week’s Lab Doc 02 for specs.
![Page 6: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/6.jpg)
“The sink sort”Better known asThe Bubble Sort!
Increasingorder
Non-decreasing order
Decreasing order
Non-increasing order
![Page 7: Northeastern Illinois Universityhomepages.neiu.edu/~faporps/2020Spring/cs200/Conc… · Web viewConcept Guide: Arrays Course: CS 200 Introduction to Java Programming, Comprehensive](https://reader033.vdocuments.mx/reader033/viewer/2022050207/5f5a7295d6b9e21d7e7f2a91/html5/thumbnails/7.jpg)
Multi-Dimensional Arrays:
Concept/Topic: Text Notes: Lecture Notes:2 Dimensional Array
Declaration(2d array)
Instantiation(2d array)
Initialization (2d array)
2d array processing
multi-dimensional arrays >2
multi-dimensional array limitations