Topics: Output, Input, Trademark Pages: 2 (391 words) Published: October 29, 2013

September 18, 2013
University of Phoenix Material

Array Structure

Parallel array structures are multiple arrays acting as one. In the regional drug company the purpose of the parallel array structure is to hold two different elements of information; one is the generic or brand name sold, and the second is the amount sold. These elements are linked to each other to describe a particular concept.

Each array will hold information for 15 days.  If I created this by using inputs without arrays, I would have had to create 30 different input statements to hold the 30 different elements of information.   Using the array is much easier and quicker. According to Stewart Venit and Elizabeth Drake book (2011) Prelude to programming 5e “array help create more efficient programs. Once data are entered into an array, data that can be processed many times without having to be input again” I just need to create a loop with an end value of 15, which represented the days the data collected. Each pass through the loop, the day would change and I would be able to enter both the generic name and the amount sold. Once the loop was completed, the array was filled with information.

In order to output the information, I would create a second FOR loop to be able to output each day moved through the second loop. I would be able to do this by creating three IF decision trees that determined whether the name is generic or brand name, and amount sold. Then I output the information to the console for each time through the loop.   I would use the console instead of the screen to be able to output more than 1 line for each loop.   This way it shows all 15 days of data weather generic or brand names and amount arrays in one Output window.   If I would have done this without using arrays and loops,   I would have had to create 3 decision trees with 3 outputs for each day of the 15 days which would...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Prg211 Individual Programming Fundamentals Essay
  • Essay about Prg211-Array Structures
  • PRG211 Algorithms Pseudocode Flowcharts Essay

Become a StudyMode Member

Sign Up - It's Free
Nexus The Jupiter Incident RELOADED [FuLL] | Gomme Quad Vee Rubber 20/11 X9 38M VRM260 pneumatici nuovi | quickbook