Describe the user-defined data type set.
Write pseudocode statements to declare the set data type, SymbolSet, to hold the following set of mathematical operators, using the variable Operators.
+ – * / ^
12 questions · 52 marks · ≈ 52 min
Describe the user-defined data type set.
Write pseudocode statements to declare the set data type, SymbolSet, to hold the following set of mathematical operators, using the variable Operators.
+ – * / ^
Describe the user‑defined data type record.
A programmer defines a record, Order, to store the following data:
Write pseudocode statements to define this record.
Explain what is meant by non-composite and composite data types.
Explain what is meant by the term non-composite data type and give an example of a non-composite data type.
Write pseudocode statements to declare the set data type EvenNumbers to hold this set of even numbers between 2 and 12:
2, 4, 6, 8, 10,12
Describe what is meant by enumerated and pointer data types.
Describe what is meant by composite and non‑composite data types.
A weather station program records the condition of the sky at each reading.
The sky condition is always exactly one of these five values:
Clear, Cloudy, Rain, Snow, Fog
Write the pseudocode statement to define the enumerated data type SkyState to hold these values.
A program monitors the temperature inside a cold store. Each temperature is stored as a REAL value.
The program needs a user-defined non-composite data type that will hold the memory location of a temperature value, and a variable of that type.
Give the pseudocode statements to:
TTempPointerTempStore of that type.A library program uses this user-defined data type:
The variable ThisMember, of type MemberLevel, has already been declared.
Write pseudocode to:
Silver in ThisMemberDiscount applies when ThisMember holds Gold or PlatinumNo discount in every other case.A programmer is choosing a composite user-defined data type for each of three requirements.
Complete the table by writing the most appropriate composite user-defined data type for each requirement.
| Requirement | Composite data type |
|---|---|
| A collection of the valid currency symbols used by a program. Every symbol is a CHAR and the order of the symbols does not matter. | |
| A group of related items about one employee: family name, salary and start date. | |
| A template that groups data together with the procedures and functions that operate on that data. |
A sports club program already contains this user-defined data type:
Write pseudocode statements to define the composite data type ClubMember to hold data about one member, including:
Use the data type Membership in your answer.
A sports club program contains these user-defined data types:
The program declares an array that has already been filled with the 200 members of the club:
Write pseudocode to count how many members are in the Senior category, and to output that count after every member has been checked.