• 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/40

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;

40 Cards in this Set

  • Front
  • Back

What is a user defined data type?

Is a data type based on the existing data type or other data type that is defined by the programmer


It can be divided into Non-composite and composite data types

What is a non composite data type?

It is a data type that does not reference to other data type

What is an enumerated data type?

Is a non composite data type that is defined by given a list of possible values that has an implied order



A list of prescribed values are created for this user-defined data type, which is defined by the user



An object of that data type can then be declared and assigned one of those prescribed values


Much in the same way an INTEGER data type must be a number from 0 to thelargest recognised by the language


a STRING must be a character in the UNICODE acceptable list


a USER-DEFINED data type be within the user-defined list of prescribed values


Enumerated values are ORDINAL meaning they have a specific order


Allows for comparison statement

What are the advantages of user defined data type?

When there’s no suitable data type is provided by the language used theProgrammer needs specify a new data type that meets the requirement of theprogram



Ability to self-document user data structures



Let’s user to group data of different types in a single variable

What is the disadvantage of user defined data type?

Only possible if a programming language offers support for the construct

What are the examples of uses of non composite data type?

Ex: Integer, Real, String, Char, Pointer

What is the pointer data type?

Non composite data type that uses the memory address of the data

What are composite data types?

A data type that refers to any other data type in its type definitions

What is a set?

A given list of unordered elements that can use theory operations

What is a class?

The composite data type that includes variables of given data types and methods

What is serial file organization?

A method of file organization in which the records of data are physically stored in a file from one after another in the order that they were added to the file




New records will be recognized at the end of the file




It uses temporary file soring transactions to be made to more permanaent files

What is sequential file organization

A method of file organization in which records of data are physically stored in the file one after another in a given order


The order is based on the key field or the records

What is the random file organization?

A method of file organizations which records the data physically in any available position




The location of file can be found by using hashing algorithm

What is file access?

The methods used to physically find a record in the file

What is sequential access?

A method of file access that uses to physically find the record in the file one after another from the start of the file until the file is found

What are the types of sequential access?

SERIAL FILE
-> If the particular record needs to be searched for, the record needs to be checked until the record is found or the whole file has been searched and no record is found




-> Any new records are recognized at the end of the file


SEQUENTIAL FILE


-> If a particular record needs to be searched for it checks the records until it is found or the key field that is being checked is greater than the key field that is being searched




-> Any new records to be stored are inserted in the correct place in the file




-> It is efficient when every record in the file needs to be processed



What is direct access?

To physically find a record in a file without other records being physically read




It allows specific records to be found more quickly than sequential access




It is required when an individual record from a file needs to be processed





How direct access works for a sequential file?

An index of all key fields is kept and used to look up the address of the file location where a given record is stored

How direct access works for a random access file?

A hashing algorithm is used on the key field to calculate the address of the file location where a given record is stored

What are hashing algorithms

A mathematical formula used to perform a calculation on the key field of the record




The result of the calculation gives the address where the record should be found

How to write records

1) Choose a suitable number and divides this number by the value in the key field


2) Remainder form the division identifies the address in the file for storage of the record

How does collision occur?

It occurs when there is same remainder and same address in both files when they use the same file location

How to read a record from a file using direct access?

The address of the location to read from is calculated using the hashing algorithm and the key field of the record stored there is read


But before using that record, the key field must be checked against the original key field to ensure they match




If the key fields don't match then the following records need to be read until a match(open hash) is found or the overflow area needs to be searched for a match(close hash)

What is normalisation?

It ensures more bits are assigned to the mantissa so accuracy is ensured

What happens when more bits are allocated for the exponent?

The range of numbers increases and the accuracy will decrease

What happens when more bits are allocated for the mantissa ?

The accuracy will increase but the range will decrease

What is the largest positive number

0 111 111 111 11 | 0111

What is the smallest positive number

01000 000 | 1000

What is the largest magnitude negative number

1 000 000 000 00 |0111

What is the smallest magnitude negative number

1 0 111 111|1000

What are the problems of floating point numbers?

Overflow


-> If the result produces a number that exceeds the maximum possible value that can be stored in the mantissa and exponent


Underflow


-> If the result produces a number less than the smallest number that can be stored


Unable to store 0


-> Mantissa must be 0.1 or 1.0 which don't allow for a 0 value

What are the advantages of using serial file organization?

No need to re-sort data every time there is new data added


Only a small file so searching will require little processing


New records can be easily apprenhended

How to add a record added to the random file?

The record is hashed to produce the home location of the file


If the location is free then insert the data else use the overflow method to find the free location

What is the purpose of user-defined data type?

To create a new data type from existing data types




• To allow data types not available in a programming language to beconstructed




To extend the flexibility of the programming language

What is the consequence and justification of storing the binary number in a normalized floating point representation as a floating point number in this system?

Consequence




• The accuracy of the number would be reduced




Justification




because the least significant bits of the original number have been lost

Compare sequential and serial methods of file organization.

Serial files are stored in chronological order




Sequential files are stored with ordered records which are stored in the order of the key field




In serial files, new records are added in the next available space




In sequential files, new records are inserted in the correct position.



State the most suitable method of file access when a record is referenced by a unique address on a disk-type storage medium.

Direct

State the most suitable method of file access when a bank stores its data records in ascending order of account number.

Sequential

State when underflow occurs in a binary floating-point system.

Following an arithmetic operation when the result is too small to be precisely represented in the available system

Why some binary representations can lead to rounding errors?

There is no exact binary conversion for some numbers.


More bits are needed to store the number than are available