Describe the purpose of a user-defined data type.
- (a)Describe the purpose of a user-defined data type.[2]
- (b)(i)Define, using pseudocode, the following enumerated data types: (i) SchoolDay to hold data about the days students are usually in school.[1]
- (b)(ii)(ii) WeekEnd to hold data about the days that are not school days.[1]
- (c)Define, using pseudocode, the composite data type ClubMeet. This will hold data about club members that includes: • first name and last name • the two days they attend: o one on a school day o one not on a school day. Use the enumerated types you created in part (b).[4]
Mark scheme
Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.
- [1] (a) To create a new data type (from existing data types)
- [1] (a) To allow data types not available in a programming language to be constructed // To extend the flexibility of the programming language
- [1] (b)(i) TYPE SchoolDay = (Monday, Tuesday, Wednesday, Thursday, Friday)
- [1] (b)(ii) TYPE WeekEnd = (Saturday, Sunday)
- [1] (c) TYPE ClubMeet and ENDTYPE correct
- [1] (c) DECLARE FirstName and DECLARE LastName included with correct data types
- [1] (c) DECLARE Schoolday included with correct data types from part 2(b)(i)
- [1] (c) DECLARE Weekend included with correct data types from part 2(b)(ii)
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →