CprS 157 Schedule
CprS 157 Class 15
CprS 157 Class 17
Chapter 12 - Class 16
- structured data type
- collection of components
- components are the same type
- components accessed by indexes
- each dimension is used to represent a different feature
- declaring a one-dimensional array
- initializing the array
- accessing array components
- out of bounds problems
- aggregate operations limited to strings (discussed in next chapter)
- parallel array processing
- passing arrays as parameters
- always passed by reference
- use of base address rather than &
- use of const in declaration
Reading Some Sample Programs
// There are two lists of integers in a data file, separated by a
// negative integer. This program compares the two lists. If they
// are identical, a message is printed. If not, nonmatching pairs
// are printed. Assumption: The lists are of equal length
The CheckLists program illustrates several important applications of arrays to common programming tasks.
Solve this exercise in class, to your own satisfaction. If called for,
create the appropriate data files and test your program on your data.
Demonstrate your solutions to the instructor or to the class TA. There is
nothing to hand in from this activity.
Homework For Chapter 12
Statistical analysis has permeated modern society -- even our classroom! Today's project asks you to write a program that accepts numerical data as input and produces as output certain statistics derived from that data, and even a primitive sort of graphical display summarizing the data. Carefully follow the specifications in the text and use all of the software development guidelines you know to make a disciplined, careful development of your program design. Writing a correct solution to programming project 11.3 should put you in a strong position to reuse some of your software in solving problem 11.5. The reuse of software components is a major issue in today's programming landscape. Strive for clear, elegant, and correct code. Include enough comments for a knowledgeable reader to have no difficulties in following your lines of thought. Enjoy!
Programming Problems 12.2 and 12.4, pages 738-739 (Statistics)