WorksheetsData Representation and File Organisation Quiz
Total questions: 91
Worksheet time: 47mins
Which of the following is a user-defined data type?
Integer
Float
Record
Boolean
What is the main purpose of hashing algorithms in data representation?
To sort data alphabetically
To compress data for storage
To map data to unique values for efficient access
To convert data into binary format
Which data type is most appropriate for storing a student's mark?
String
Integer
Boolean
Date
Which method of file organisation allows for data to be accessed in the order it was stored?
Random access
Sequential access
Direct access
Hashing
Why is the normalisation of binary floating-point numbers important?
It increases the speed of data transmission
It ensures consistent representation and accuracy
It compresses the data for storage
It converts binary numbers to denary numbers
What is a non-composite data type?
A data type that does not reference any other data types.
A data type that is made up of multiple other data types.
A data type that only stores text.
A data type that is always a pointer.
Which of the following is true about enumerated data types?
They contain no references to other data types when defined.
They always store floating-point numbers.
They are only used for mathematical operations.
They must be enclosed in quotation marks.
In pseudocode, how is an enumerated data type for months typically defined?
TYPE Tmonth = (January, February, March, April, May, June, July, August, September, October, November, December)
TYPE Month = "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
TYPE Months = [January, February, March, April, May, June, July, August, September, October, November, December]
TYPE Tmonth = {January, February, March, April, May, June, July, August, September, October, November, December}
What is the purpose of using enumerated data types in programming?
To define a list of all possible values for a variable.
To store large amounts of data efficiently.
To perform complex mathematical calculations.
To reference memory addresses directly.
Given the pseudocode: DECLARE thisMonth : Tmonth DECLARE nextMonth : Tmonth thisMonth ← January nextMonth ← thisMonth + 1 What will be the value of nextMonth?
February
January
March
December
Why are the values in an enumerated data type not enclosed in quotation marks?
Because they are not strings.
Because they are always numbers.
Because quotation marks are only used for comments.
Because they are pointers.
How would you declare an enumerated data type for the days of the week in pseudocode?
TYPE Tday = (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday)
TYPE Weekday = "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
TYPE Days = [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]
TYPE Tday = {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}
If you assign the value of Wednesday to the variable today in an enumerated data type for days of the week, what would be a suitable assignment statement for tomorrow?
tomorrow ← today + 1
tomorrow ← today - 1
tomorrow ← today * 2
tomorrow ← today / 2
Which key term refers to a non-composite data type that uses the memory address of where the data is stored?
Pointer data type
Set
Enumerated data type
User-defined data type
What is the main difference between a set and an enumerated data type?
A set is an unordered list that can use set theory operations, while an enumerated data type is a list of all possible values for a variable.
A set only contains numbers, while an enumerated data type contains strings.
A set is always composite, while an enumerated data type is always primitive.
A set is used for memory addresses, while an enumerated data type is used for months.
Which of the following best describes a pointer data type?
A data type used to reference a memory location.
A data type used to store only integer values.
A data type that cannot be used in pseudocode.
A data type that stores only user-defined types.
In pseudocode, how is a pointer type definition typically represented?
TYPE <pointer>=<Typename>
TYPE
TYPE
TYPE
What does the symbol '^' indicate in the pointer type definition in pseudocode?
The type is an array.
The type is a pointer.
The type is a constant.
The type is a function.
Given the pseudocode: TYPETmonthPointer=Tmonth , what does Tmonth represent?
The pointer variable name.
The data type stored at the memory location.
The address of the pointer.
The value of the pointer.
If you want to access the value stored at the address a pointer is pointing to, what operation must you perform?
Initialization
Dereferencing
Declaration
Assignment
What is a composite data type?
A data type that refers to any other data type in its type definition.
A data type that stores only primitive values.
A data type that cannot be used in records.
A data type that is always an integer.
(Activity 13B) Using pseudocode for the enumerated data type for days of the week, what must you do to declare a suitable pointer to use?
Set up the pointer data type and the pointer variable.
Only declare the pointer variable.
Only set up the pointer data type.
Use a composite data type instead.
How can you set a pointer to point to a specific value, such as 'today', in pseudocode?
Assign the pointer variable to the value.
Assign the value to the pointer data type.
Dereference the pointer variable.
Use a composite data type.
Which of the following is an example of a composite data type?
Integer
Set
Boolean
Character
In pseudocode, how is a set data type typically defined?
TYPE
DEFINE
DECLARE
SET
Which operation is commonly associated with set data types?
Sorting
Intersection
Concatenation
Division
Why might a programmer choose to define a user-defined data type?
To increase the speed of the program
To represent complex data structures more efficiently
To avoid using variables
To reduce the number of functions in a program
If you need to store data about each house that an estate agent has for sale, which data type would be most suitable?
Class
Boolean
Integer
Set
For storing the addresses of integer data held in main memory, which data type would be most appropriate?
Set
Pointer
Class
String
Strategically, how would you decide whether to use a set or a class for a given programming problem?
Use a set if you need ordered elements; use a class for unordered elements
Use a set for simple collections of unique items; use a class for complex objects with multiple attributes and methods
Use a class only for mathematical operations; use a set for storing text
Use a set for storing numbers; use a class for storing strings
Which of the following best describes Serial file organisation?
Records are stored in a file in any available position.
Records are physically stored in a file, one after another, in the order they were added.
Records are stored using a mathematical formula to calculate their position.
Records are stored in a file without any specific order.
What is the main purpose of a hashing algorithm in file access?
To sort records alphabetically.
To calculate the address where a record should be found.
To append new records to the end of a file.
To delete records from a file.
Which file access method allows a record to be physically found in a file without searching through other records?
Sequential access
Direct access
Serial file organisation
Random file organisation
In sequential access, how are records searched in a file?
By using a hashing algorithm to jump directly to the record.
By searching one after another from the physical start of the file until the required record is found.
By searching in random order.
By searching only the last record added.
Why is serial file organisation often used for temporary files storing transactions?
Because it allows records to be stored in any available position.
Because it stores records in chronological order as they arrive.
Because it uses a mathematical formula to find records.
Because it allows direct access to any record.
A company stores customer meter readings in a file using serial file organisation. What is the advantage of this method for billing customers?
It allows instant access to any customer's record.
It ensures that records are stored in the order of arrival, making it easy to process transactions chronologically.
It uses a hashing algorithm to find records quickly.
It stores records in random positions for faster access.
Which method physically stores records of data in a file one after another in a given order?
Sequential file organisation
Random file organisation
Direct file organisation
Indexed file organisation
In sequential file organisation, what is typically used as the key field to uniquely identify each record?
Customer name
Customer address
Customer number
Customer phone number
Which of the following best describes how new records are added in sequential file organisation?
At any empty position in the file
At the end of the file only
In the correct place based on the key field order
Randomly throughout the file
If Customer 5 is added to a sequential file containing Customers 1, 2, 3, 4, 7, and 8, where will Customer 5's record be placed?
At the end of the file
Before Customer 1
Between Customer 4 and Customer 7
After Customer 8
Which method physically stores records of data in a file in any available position?
Sequential file organisation
Random file organisation
Direct file organisation
Indexed file organisation
What is used to determine the location of any record in a random file organisation?
Sorting algorithm
Hashing algorithm
Searching algorithm
Indexing algorithm
In random file organisation, where can new records be added?
Only at the end of the file
Only at the beginning of the file
At any empty position
Only in alphabetical order
Which of the following is NOT a method of file access mentioned in the text?
Sequential access
Direct access
Indexed access
File access
What does the sequential access method do when searching for a record in a file?
Searches records in random order
Searches records one after another from the physical start of the file
Uses a hashing algorithm to find the record
Searches only the last record
For a serial file, what happens if a particular record is being searched for and is not found after searching the whole file?
The search stops and no new records are added
The search continues in reverse order
New records are appended to the end of the file
The file is deleted
For a sequential file, when searching for a particular record, when does the search stop?
When the record is found or the key field of the current record is greater than the key field of the record being searched
When the record is found or the end of the file is reached
When the record is found or the file is sorted
When the record is found or the file is deleted
Which type of file access is most efficient when every record in the file needs to be processed, such as in a monthly billing system?
Sequential access
Direct access
Random access
Hashing algorithm
What is the main advantage of direct access over sequential access when updating a single record in a file?
Direct access is slower than sequential access
Direct access allows specific records to be found more quickly
Direct access requires searching the whole file
Direct access is only used for encrypted data
Which method uses a mathematical formula to calculate the address where a record should be stored in a file?
Sequential access
Direct access
Hashing algorithm
Indexing
If a file has space for 2000 records and the key field value is 3024, what would be the address to store the record using the hashing algorithm described?
3024
1024
0
2000
Explain why a hashing algorithm might be preferred over sequential access for storing and retrieving records in a large file. Use evidence from the text to support your answer.
Hashing algorithms are slower and less efficient than sequential access
Hashing algorithms allow direct calculation of record addresses, reducing search time
Hashing algorithms require searching the whole file
Hashing algorithms are only used for encrypted data
Which of the following best describes a collision in hashing algorithms for direct access to records in a file?
When two records have the same key field
When two records try to use the same file location
When a record cannot be found in the file
When the hashing algorithm fails to generate an address
What is the main difference between an open hash and a closed hash in file organisation?
Open hash stores records in the next free space, closed hash uses an overflow area
Open hash uses an overflow area, closed hash stores records in the next free space
Open hash is used for sequential files, closed hash for serial files
Open hash does not use hashing algorithms, closed hash does
When reading a record from a file using direct access and hashing, what must be checked before using the record?
The file type
The size of the record
The key field against the original key field
The number of records in the file
Explain, using examples, the difference between serial and sequential files.
Serial files store records in order of key field, sequential files store records randomly
Serial files store records randomly, sequential files store records in order of key field
Both store records in order of key field
Both store records randomly
If a file of records is stored at address 500 and each record takes up five locations, what is the address to store the record with key field 9354 using the hashing algorithm described?
9354
9354 divided by 1000 plus 500
9354 mod 1000 plus 500
9354 mod 1000 plus 500 plus (size of record)
If the location calculated for storing a record has already been used and an open hash is used, what is the address of the next location to be checked?
The previous location
The next free space in the file
The overflow area
The start address of the file
Choose an appropriate file type for recording daily rainfall readings at a remote weather station to be collected every month. Give the reason for your choice.
Serial file, because records are stored randomly
Sequential file, because records are stored in order of key field
Sequential file, because data is collected regularly and needs to be accessed in order
Serial file, because data is collected irregularly
A hashing algorithm adds up the ASCII values for every character in a name, divides by the number of locations in the file, and uses the remainder as the basis for the address. What is the purpose of multiplying this value by 20 and adding it to 2000 in the extension activity?
To increase the randomness of the address
To ensure the address is within a specific range
To make the calculation more complex
To avoid collisions entirely
Which of the following denary numbers, when converted to binary, would require the use of two's complement representation?
+48
+122
-100
123000000
What is the binary equivalent of the denary number 122?
01111010
01111110
10111010
11111111
Convert the binary number 00110011 to denary.
51
27
19
35
Which binary number represents the denary value 255?
11111111
10101010
11001100
10000000
Using two’s complement, what is the negative value of the binary number 00011001?
11100111
11100110
11100101
11100100
What is the result of adding the binary numbers 00110001 and 00011110?
01001111
01001010
01010101
01011000
Express 123,000,000 in standard form.
1.23×108
1.23 × 10^7
12.3×106
123×105
Which of the following is the correct standard form for 2,505,000,000,000,000?
2.505×1015
25.05×1014
250.5×1013
2505×1012
In standard form, how can the improper fraction 14/5 be written?
1.4×101
2.8×101
14×105
2.8×105
When converting improper binary fractions, what is the value of 7/8 in binary using powers of 2?
7×2−3
7×23
8×2−7
8×27
Given the binary fraction 11/2, how can it be written using powers of 2?
11×2−1
2×2−11
1×2−11
2×211
If you are asked to convert the binary number 11111110 to denary, which skill or concept are you applying?
Recall
Application of binary to denary conversion
Strategic reasoning
Standard form conversion
Why is two’s complement used in binary arithmetic?
To represent positive numbers only
To represent negative numbers in binary
To convert binary to denary
To add binary numbers
A student is given the binary addition problem: 11111110 + 01111110. What is the first step they should take to solve it?
Align the numbers and add each bit starting from the rightmost bit
Convert both numbers to denary first
Subtract the smaller number from the larger
Write the numbers in standard form
When converting improper binary fractions into proper binary fractions, which mathematical concept is primarily used?
Powers of 2
Powers of 10
Decimal places
Two’s complement
Which term refers to the fractional part of a floating point number?
Mantissa
Exponent
Overflow
Underflow
What is the result called when a calculation produces a value too large for the computer’s allocated word size?
Overflow
Underflow
Mantissa
Exponent
What is the binary floating-point number written in the form of?
M × 2ᴱ
M + E
M ÷ E
M × E
Which method is used to improve the precision of binary floating-point numbers?
Normalisation (floating-point)
Exponentiation
Rounding
Truncation
What does the exponent represent in a floating-point number?
The power of 2 that the mantissa is raised to
The fractional part of the number
The total number of bits used
The sign of the number
Why does fixed-point representation limit the range of numbers and not allow for fractional values?
Because the number of bits is fixed and does not allow for fractions
Because it uses floating-point representation
Because it uses scientific notation
Because it allows for unlimited range
If a computer uses 8 bits for the mantissa and 8 bits for the exponent, what is assumed about the binary point in the mantissa?
It exists between the first and second bits
It is always at the end
It is always at the beginning
It does not exist
What is the result called when a calculation produces a value too small for the computer’s allocated word size?
Underflow
Overflow
Mantissa
Exponent
Which part of the scientific notation 3.1211 × 10²³ is the mantissa?
3.1211
10
23
2
How does using binary floating-point representation increase the range and allow for fractions compared to fixed-point representation?
By using separate bits for mantissa and exponent
By using only the exponent
By using only the mantissa
By ignoring fractional values
Which of the following is the correct denary value for the binary floating-point number with mantissa 0.1011010 and exponent 4?
11.25
10.5
12.75
9.25
What is the value of the mantissa when the bits 0.1011010 are used, considering only the positions where the bit is 1?
45/64
32/64
23/64
64/64
If the exponent is 4, how many places should the binary point be moved to the right in the mantissa according to Method 2?
4 places
2 places
8 places
1 place
Given the mantissa bits 0 1 0 1 1 0 1 0, which fractional values should be added to calculate the mantissa value?
1/2, 1/8, 1/16, 1/64, 1/128
1/2, 1/8, 1/16, 1/64
1/2, 1/8, 1/64, 1/4, 1/32
1/2, 1/4, 1/8, 1/16, 1/32
If you are given a binary floating-point number with mantissa 0.0101000 and exponent 3, what is the first step to convert it to denary using Method 2?
Write the mantissa as 0.0101000 and move the binary point three places to the right
Add all the mantissa bits together
Multiply the mantissa by 2^3
Subtract the exponent from the mantissa
What is the value of the mantissa (M) when the bits with value 1 are at positions corresponding to 1/4, 1/16, and 1/16?
5/16
1/4
1/2
3/16
