0% found this document useful (0 votes)
23 views23 pages

Lecture 1.8 - Subtypes of Basic Datatypes

Uploaded by

parasmahajan257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views23 pages

Lecture 1.8 - Subtypes of Basic Datatypes

Uploaded by

parasmahajan257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Subtypes

Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
SeqNo
Range of values is: ?
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
SeqNo
Range of values is:
0,1,2,....,Max

Max can be some reasonable number, e.g. 10000,


which is the largest data set size that we can handle
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
SeqNo
Range of values is:
0,1,2,....,Max

Max can be some reasonable number, e.g. 10000,


which is the largest data set size that we can handle
None of the integer operations make sense for the SeqNo data type
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Marks
Range of values is: ?
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Marks
Range of values is:
0, 1, 2, 3, ..., 100
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Marks
Range of values is:
0, 1, 2, 3, ..., 100
Operation Result type
??
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Marks
Range of values is:
0, 1, 2, 3, ..., 100
Operation Result type
+, - Marks

×, ÷ do not make sense for marks


Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Marks
Range of values is:
0, 1, 2, 3, ..., 100
Operation Result type
+, - Marks
<, >, = Boolean
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Count
Range of values is:
?
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Count
Range of values is:
0, 1, 2, 3, ...
Operation Result type
??
Subtypes of Integer
Range of values is:
Integer ... , -3, -2, -1, 0, 1, 2, 3, ...
Operation Result type
+, - , ×, ÷ Integer
<, >, = Boolean
Count
Range of values is:
0, 1, 2, 3, ...
Operation Result type
+, - Count
<, >, = Boolean
×, ÷ do not make sense for counts
Character Data Type and its subtype
Values - alphanumeric:
Character A B ... Z a b ... z 0 1 ... 9
Special characters:
. , ; : * / & % $ # @ ! ...
Operation Result type
= Boolean

Gender
Values: ?
Character Data Type and its subtype
Values - alphanumeric:
Character A B ... Z a b ... z 0 1 ... 9
Special characters:
. , ; : * / & % $ # @ ! ...
Operation Result type
= Boolean

Gender
Values: M or F
Character Data Type and its subtype
Values - alphanumeric:
Character A B ... Z a b ... z 0 1 ... 9
Special characters:
. , ; : * / & % $ # @ ! ...
Operation Result type
= Boolean

Gender
Values: M or F
Operation Result type
?
Character Data Type and its subtype
Values - alphanumeric:
Character A B ... Z a b ... z 0 1 ... 9
Special characters:
. , ; : * / & % $ # @ ! ...
Operation Result type
= Boolean

Gender
Values: M or F
Operation Result type
= Boolean
String Data Type and its subtypes
Values - any sequence of
String characters
String Data Type and its subtypes
Values - any sequence of
String characters
Operation Result type
char in string? Boolean
= Boolean
....
String Data Type and its subtypes
Values - any sequence of
String characters
Operation Result type
char in string? Boolean
= Boolean
....

Names
Values: Strings with only
alphabet characters
Operation Result type
= Boolean

Note - Change from video: String made more restrictive and operation added
String Data Type and its subtypes
Values - any sequence of
String characters
Operation Result type
char in string? Boolean
= Boolean
....

City
Values: Strings with only
alphabet characters
Operation Result type
= Boolean

Note - Change from video: String made more restrictive and operation added
String Data Type and its subtypes
Values - any sequence of
String characters
Operation Result type
char in string? Boolean
= Boolean
....

Words
Values: Strings with
alphanumeric and . , ; : ...
Operation Result type
= Boolean

Note - Change from video: operation added


String Data Type and its subtypes
Values - any sequence of
String characters
Operation Result type
char in string? Boolean
= Boolean
....

Category Values: Can take only one of the values:


“Noun”, “Verb”, “Pronoun”, “Adjective”, ...
Operation Result type
= Boolean

Note - Change from video: operation added

You might also like