Preview

Data Structures, Arrays, and Modularizing

Good Essays
Open Document
Open Document
748 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Data Structures, Arrays, and Modularizing
Data Structures, Arrays, and Modularizing
-
PRG 210
November 29, 2010
-

Data Structures, Arrays, and Modularizing In a computer, “the data structure becomes an object that includes data and functions” (Robertson, 2007). It stores and organizes the data in a computer. Data structures make it possible to sort through large databases and internet indexing services. These would include online libraries, such EBSCOhost through universities, and search websites, such as Google. These would also include member profiles such as Facebook. Arrays “provide the programmer with a way of organising a collection of homogeneous data items (that is, items that have the same type and the same length) into a single data structure. An array, then, is a data structure that is made up of a number of variables all of which have the same data type” (Robertson, 2007). For example, there are 40 students in the first grade. A single variable name such as ‘first’ can be used with all 40 first grade students. “The individual data items that make up the array are referred to as the elements of the array. Elements in the array are distinguished from one another by the use of an index or subscript, enclosed in parentheses, following the array name” (Robertson, 2007), such as ‘first (8)’. This subscript refers to the eighth student in the first grade. The smallest element of an array must also be the size of the largest element, so in using the months of the year as an example, the names of the shorter months must be padded with blank spaces. The month of May must be as long as the month of September. Modularization breaks down the complexity of programming. That means that the complex problem gets divided into smaller parts, thus creating subtasks or functions from the major tasks. The subtasks can then be further divided into smaller subtasks, as long as each task or subtask is independent of all others. “There are a number of benefits from using modular design.

You May Also Find These Documents Helpful

  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    INSTRUCTIONS: 1. THERE ARE SIX (6) QUESTIONS IN THIS PAPER. 2. ANSWER FIVE (5) QUESTIONS ONLY. Question 1 Arrays are used when storing a large number of values. You are required to create an array named a and answer the following questions regarding array manipulation. a. Write a method fillRandom(int[] a, int min, int max), fill the array a with a random integer value. (Note: Math.random() returns a double in the range of 0.0 and 1.0, therefore it is cast to an integer number, between the minimum and maximum value). [6 marks] b. Write the Bubble sort method to sort array a into descending order. [10 marks] c. In the quicksort, an algorithm an element is chosen from the unsorted list. This element is called the…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture.…

    • 714 Words
    • 3 Pages
    Good Essays
  • Good Essays

    The purpose of the parallel array structure is to hold 2 different elements of information on budget numbers for each month. I created two parallel arrays one to hold the budget scheduled amount and another array to hold the budgeted amount that was achieved. Each array will hold information for each month. If I created this by using inputs without arrays, I would have had to create 24 different input statements to hold the 24 different elements of information. Using the array was much each and quicker. I just needed to create a loop with an end value of 12, which represented the 12 months of the year. Each pass through the loop, the month would change and I was able to enter both the scheduled budgeted information and the achieved budget. Once the loop was completed, the array was filled with information.…

    • 503 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Nt1330 Unit 1 Research Paper

    • 4285 Words
    • 18 Pages

    Each character requires one byte as it is usually stored as an ASCII character. Notice that a digit such as 8 could be held as either a character, an integer or even a real. If any calculations are going to take place on the value then it should be held as either an integer or a real. If the calculation will never result in it being extremely large or gaining decimal places then an integer should be used.…

    • 4285 Words
    • 18 Pages
    Powerful Essays
  • Good Essays

    Array Structure Paper

    • 833 Words
    • 4 Pages

    “An array is a collective name given to a group of similar quantities. These similar quantities could be percentage marks of 100 students, number of chairs in home, or salaries of 300 employees or ages of 25 students. Thus an array is a collection of similar elements. These similar elements could be all integers or all characters, and so on” (Thompson, 2007). Building an array can be confusing for the Bug Blasters can be very confusing for a programmer who does not fully understand how they work.…

    • 833 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Explain what is meant by a modular approach to programming. Why is this approach important?…

    • 503 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Chapter 8 Quiz

    • 469 Words
    • 2 Pages

    2. What is the term used for the number inside the bracket that specifies the number of values that an array can hold? (Points : 7)…

    • 469 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    A database is a computer mechanism for storing and retrieving data. It gives one true command of their data, enabling one to retrieve it, sort it, analyze it, summarize it, and report results in changes.…

    • 598 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    ch02 c

    • 2468 Words
    • 11 Pages

    9. The term “data structures” refers to the speed at which data it is captured, analyzed, and reported.…

    • 2468 Words
    • 11 Pages
    Powerful Essays
  • Satisfactory Essays

    Explain what is meant by a modular approach to programming. Why is this approach important?…

    • 503 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Design a modular program that asks the user to enter a distance in kilometers, and the converts that distance to miles. The conversion formula is as follows:…

    • 620 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Dbm 381 Week 1paper

    • 885 Words
    • 4 Pages

    A database consists of one or more tables; each containing data stored as individual records. Different database architectures determine how the tables and records are organized or related…

    • 885 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    It 218 Week 4 Checkpoint

    • 290 Words
    • 2 Pages

    An array is a variable that holds more than more than one value, and an array can be combined with multiple variables for a more complex structure. An array is declared much similar with any other variable. The only difference is the number of elements is shown in brackets. An example of an array will be look much like these three: calories [ min ], 30 [ 7 ], and feet [ 12 ]. Each one of these arrays can be used as long as it is appropriate for the program.…

    • 290 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    - The voices that represent aspects of old and new Afghanistan (Assef - Taliban, Farid - How Afghanistan used to be)…

    • 687 Words
    • 3 Pages
    Good Essays