• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/19

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

19 Cards in this Set

  • Front
  • Back

Name the 5 main datatypes, and how many bytes they are.

1. String - depends on number of chars.
2. Char - 1 byte.
3. Integer - 4 bytes.
4. Double - 4 bytes.
5. Boolean - 1 byte.
Define Array.
Data structure that contains SEVERAL types of data of the same datatype under one identifier.
When you are declaring an array, what would you need to write?
1. Identifier of array - allows data to be accessed.
2. Size of array - enable locations that are next to eachother.
3. Datatype of contents - determine correct rules for manipulation.
What are the advantages of using an array?
1. Code is easier to manage as there are fewer variables.
2. Can use iteration when processing all elements in the array instead of dealing with each element separately.
3. Code will be easily scaleable by changing the size of the array.
Write, in pseudo code, how you would initialise an array.
FOR i=1 TO length of array
nameofArray(i) = 0
NEXT i
Define 2D Array
A data structure that stores MULTIPLE items of data of the same datatype under one identifier. It uses 2 index numbers and it can be represented in a table.
Define Record.
A data structure that can store together data items about a person or thing. The data items CAN be different datatypes.
How would you estimate the size of a file?
1. Add up the total for 1 record.
2. Multiply that number by the number of records.
3. Add an extra 10% for overheads.
4. Divide by 1000 to convert to kB.
Name the types of file.
1. Serial File.
2. Sequential File.
3. Indexed Sequential File.
4. Direct Access.
5. Random Files.
What is a serial file?
The data is stored in the order that it was entered.
What is a sequential file?
The data is stored according to a key field in the data.
What is an indexed sequential file?
The data is arranged with a key field but also has an index which is used to jump to certain blocks of data so records can be found quicker.
What is direct access?
If records in a sequential file have a fixed length then it may be possible to read the contents of a file directly if you know its position.
What are random files?
When records can be stored anywhere on a section of a disk.
What are the advantages of a serial file?
- Data can just be added to the end of a file.
- Easy to program.
What are the disadvantages of a serial file?
- When searching for data, you must start at the front and check each file one-by-one until you find the file you're looking for.
- If the item you want is at the end or not in the file at all, you would have to search through every single item before you can be certain.
When would you use a serial file?
- It doesn't matter what order the data is stored in.
- The data needs to be stored in the order that it's received.
- The data does not require searches to pick out individual records.
When would you use a sequential file?
- If it mattered what order the data should be in.
- You need to search for data frequently.
What are the advantages of a sequential file?
- Large files
- As accessing specific data will be quicker than using a serial search as you can skip over certain records.