PDF Google Drive Downloader v1.1


Báo lỗi sự cố

Nội dung text P3 Notes.pdf


AS COMPUTER SCIENCE P3 2 | P A G E ABDUL REHMAN YASER Chapter 13 – Data Representation 13.1 User Defined Data Types User-defined data type – a data type based on an existing data type or other data types that have been defined by a programmer. Non-composite data type – a data type that does not reference any other data types. Some non-composite data types already in programming language are string, integer, real, date, char, Boolean. Non-composite user-defined data types are usually used for a special purpose. Single Data Type that doesn’t involve a reference to another type Enumerated data type – A user-defined non-composite data type with an ordered list of all possible values. Pointer data type – A user-defined non-composite data type used to reference a memory location. Set – a given list of unordered elements that can use set theory operations such as intersection and union. User Defined Datatype • A datatype constructed by the programmer • Derived from one or more datatypes • Used to extend built in datatypes • Created data types specific to programs Purpose of User Defined Datatype • To extend flexibility of a program • To create new datatype from existing datatypes, or two create a new datatype that meets requirements of program • No suitable datatype available in programming language
AS COMPUTER SCIENCE P3 3 | P A G E ABDUL REHMAN YASER Non-composite data types Enumerated Data Type A user-defined non-composite data type with an ordered list of all possible values. An enumerated data type contains no references to other data types when it is defined. When a specific enumerated data type is defined, every single possible value for it is identified. It is important to note the following points. • The values of the enumerated type look like string values but they are not. The values must not be enclosed in quotes. • The values defined in an enumerated data type are ordinal. This means that enumerated data types have an implied order of values. The ordering can be put to many uses in a program. For example, a comparison statement can be used with the values of the variables of an enumerated data type: DECLARE Weekend : Boolean DECLARE Day : TDays Weekend = TRUE IF Day > Friday Pointer data type A user-defined non-composite data type used to reference a memory location . This data type needs to have information about the type of data that will be stored in the memory location. In pseudocode the type definition has the following structure, in which ^ shows that the type being declared is a pointer and is the type of data to be found in the memory location, for example INTEGER or REAL, or any user- defined data type.

Tài liệu liên quan

x
Báo cáo lỗi download
Nội dung báo cáo



Chất lượng file Download bị lỗi:
Họ tên:
Email:
Bình luận
Trong quá trình tải gặp lỗi, sự cố,.. hoặc có thắc mắc gì vui lòng để lại bình luận dưới đây. Xin cảm ơn.