10-09-09 - grouping data items together in such a way that...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Example: Arrays (data structure) This program illustrates these new concepts: arrays (data collections) document.write to put output onto a new browser page random number generation This program illustrates the use of an array to group together data items that have different values, but are related in some way or used in some common fashion. Arrays give us the ability to group values into collections that allow us to access the individual values systematically. Arrays are one example (widely used) of a general concept called "structured data", or data structures. This is
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: grouping data items together in such a way that relationships amoung the data items are implied, and so that the group can be manipulated as a group when desired or as individual elements when needed. Input No user input. Input is done using the random number generator to put a number between 0 and 100 into each array slot. Output The program prints the sum of the generated values, and the average. It also prints the largest value. Termination The program ends automatically...
View Full Document

Ask a homework question - tutors are online