大象传媒

Storage and data organisation - EduqasFile design

Arrays form the basis for how data is stored within a program. They must be declared with meaningful identifier names and appropriate data types that match the data. Without the correct data structures and data types, programs will not work.

Part of Computer ScienceUnderstanding Computer Science

File design

When planning programs that store in a file, it is important to consider the following:

  • file names

It is also useful to include some example data to display the types of data that may be stored.

Field nameData typeExample dataValidation check
Employee IDInteger1Presence check
First NameStringFriedrichPresence check
SurnameStringMullerPresence check
Date of BirthDate30/01/1997Format check
SalaryReal18573.50Range check
GenderCharacterMLength check
Field nameEmployee ID
Data typeInteger
Example data1
Validation checkPresence check
Field nameFirst Name
Data typeString
Example dataFriedrich
Validation checkPresence check
Field nameSurname
Data typeString
Example dataMuller
Validation checkPresence check
Field nameDate of Birth
Data typeDate
Example data30/01/1997
Validation checkFormat check
Field nameSalary
Data typeReal
Example data18573.50
Validation checkRange check
Field nameGender
Data typeCharacter
Example dataM
Validation checkLength check

Question

Create a file design to store a radio station鈥檚 music catalogue. Include the name of the artist, the song title, the year it was released, the genre (pop, rock, blues, etc.) and the length of the song.