DOC PREVIEW
TAMU CSCE 110 - 15-ordinalDataTypes
Type Miscellaneous
Pages 10

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Ordinal Data TypesData TypesType DeclarationsType Declaration ExamplesEnumerated TypeEnumerated Type ExampleSlide 7Ordinal Type OperationsSubrange TypeSubrange Type ExampleOrdinal Data TypesCSCE 110Data Typessimplestructuredpointerordinal realpredefinedbooleancharintegerprogrammer-definedenumerated subrangearray recordset filepredefined programmer-definedtextType Declarationstype name-1 = type-1; name-2 = type-2; . . . name-m = type-m;Type Declaration Examplestype filename_type = array[256]; logical_type = boolean;var filename: filename_type; p, q, r: logical_type;Enumerated Type•Purposes–More _____________________ code–_______ prevention( ident-1, ident-2, … ident-n )Enumerated Type Exampletype daysOfWeek = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday );var day:daysOfWeek;Enumerated Type Examplefor day:=Sunday to Saturday do case day of Sunday: writeln('Sunday'); Monday: writeln('Monday'); Tuesday: writeln('Tuesday'); Wednesday: writeln('Wednesday'); Thursday: writeln('Thursday'); Friday: writeln('Friday'); Saturday: writeln('Saturday'); endOrdinal Type Operations•Enumerated types, integer, char, & boolean–_____–_____–_____–<, <=, =, >=, <>Subrange Type•Purposes–_______ prevention–Generalization of _________________ type (i.e. simpler to write)first-value..last-valueSubrange Type Exampletype digit_type = '0'..'9'; capitalLetters_type = 'A'..'Z'; lowerCaseLetters_type = 'a'..'z';var cents: 0..99; daysInMonth: 28..31; bigLetter: capitalLetters_type; smallLetter:


View Full Document

TAMU CSCE 110 - 15-ordinalDataTypes

Type: Miscellaneous
Pages: 10
Documents in this Course
06-IO

06-IO

29 pages

21-OOP

21-OOP

8 pages

key

key

6 pages

21-OOP

21-OOP

8 pages

Load more
Download 15-ordinalDataTypes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view 15-ordinalDataTypes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view 15-ordinalDataTypes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?