Types A type consists of –a set of values –a set of operations on those values Types can be –primitive (atomic, non-decomposable) –composite (includes.

Slides:



Advertisements
Similar presentations
CISC Data Structures Ben Perry University of Delaware Summer 2011.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Year 10 ISA Controlled assessment Week starting March 4 th 2013.
Operation Research By Anitha Chandran Chitra.R Radha.R Sudhit Sethi.
Chapter 3 DATA: TYPES, CLASSES, AND OBJECTS. Chapter 3 Data Abstraction Abstract data types allow you to work with data without concern for how the data.
Today Is Sunday By Dr Jean.
23-Apr-15 Abstract Data Types. 2 Data types I We type data--classify it into various categories-- such as int, boolean, String, Applet A data type represents.
TEST YOUR READING SKILLS : See a day of the week written in French. Say what you think it is. Click to check your answer.
Random Numbers In today’s lesson we will look at: why we might want a random number whether they really are random how to create and scale random numbers.
Ain't It A Shame 1-4 Aint it a shame to work on Sunday, Aint it a shame, (a working shame,) Aint it a shame to work on Sunday, Aint it a shame, (a working.
1 The seven days of the week. 2 Monday is our washing day. Scrub, scrub, scrub.
QUESTION 1 What day is it today? A) I’m Tuesday. B) I have Tuesday. C) Tuesday. D) It’s Tuesday.
2012 CALENDAR. JANUARY 2012 Sunday 日 Monday 月 Tuesday 火 Wednesday 水 Thursday 木 Friday 金 Saturday 土
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 5 Types Types are the leaven of computer programming;
D AYS OF THE W EEK Jordan Brungard Lesson Plan. N UMBER OF DAYS IN A WEEK There are seven days in a week. Sometimes people think that there are only 5.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 5 Types Types are the leaven of computer programming;
Types A type consists of –a set of values –a set of operations on those values Types can be –primitive (atomic, non-decomposable) –composite (includes.
TYPE EQUIVALENCE 1) Coercion 2) Casting 3) Conversion.
1) Enumerated types 2) Records and structures 3) Accessing fields in records/structures 4) Operations on records/structures 5) Variant records 6) Dynamic.
Primitive Data Types: Numbers Strings Ordinal Types Pointers
Saturday May 02 PST 4 PM. Saturday May 02 PST 10:00 PM.
Variables and constants Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences.
Programming Environments DrJava is not Java! It is an integrated environment for developing Java programs DrJava integrates the Edit => Compile => Run.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 23P. 1Winter Quarter Structs and Enumeration.
© C (Basic) Data Types -different data representations need different types in programming- 1/31.
ARISE Summer Institute UC Davis June 17-June 22, 2011.
C++ Workshop Mark Hennessy Dept. Computer Science 18 th – 22 nd September 2006.
Class Schedule Template SundayMondayTuesdayWednedayThursdayFridaySaturday 6 AM 7 AM 8 AM 9 AM 10 AM 11 AM 12 AM 1 PM 2 PM 3 PM 4 PM 5 PM 6 PM Title Classroom.
Days of the week instructions. Children can; Order the days of the week. Use sentence strips and activity cards to write sentences about what they do on.
(Tentative) Plan for Last Days of School. Friday 5/8 / Monday 5/11 Work on empathy final project Tuesday 5/12 / Wednesday 5/13 (MIN.) Work on empathy.
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++ (4)
Functions in C. Consider #include main() { int i; for(i=1; i
Week 9 - Friday.  What did we talk about last time?  typedef  Linked lists.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 23P. 1Winter Quarter Structs and Enumeration Lecture 23.
C++ Workshop Sujana Jyothi Dept. of Computer Science.
 Character set is a set of valid characters that a language can recognise.  A character represents any letter, digit or any other sign  Java uses the.
Compound Statements If you want to do more than one statement if an if- else case, you can form a block of statements, or compound statement, by enclosing.
Click the button to begin. 12:25 What time does this clock show? 5:00 4:00.
ISBN Chapter 6 Data Types Introduction Primitive Data Types User-Defined Ordinal Types.
Types(1). Lecture 52 Type(1)  A type is a collection of values and operations on those values. Integer type  values..., -2, -1, 0, 1, 2,...  operations.
A Dog for Each Day Written by: Rosie Portera, M.S., CCC-SLP.
Programming Fundamentals. Today’s Lecture The Conditional Operator Logical Operators Structures Enumerations.
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
7 th Grade Language Arts Monday, October 5, 2015 No DOL this week Harris and Me Begin writing assessment- “Seventh Grade” Must be submitted by Friday at.
Object Oriented Software Development 4. C# data types, objects and references.
Simple Data Types Chapter Constants Revisited t Three reasons to use constants –Constant is recognizable –Compiler prevents changes in value.
Weekly C-minar Week 0. Today: Steps of the compile Basic inclusion/syntax rules Low-cost containment Debugging.
CSci 162 Lecture 2 Martin van Bommel. Enumeration –process of listing all of the elements in the domain of a type Enumerated type –type defined via enumeration.
Got a reason Got a reason for living again, got a reason for laughing again got a reason for loving again, I‘ve got the love of God in my heart. No reason.
CSED101 INTRODUCTION TO COMPUTING SUM TYPE 유환조 Hwanjo Yu.
Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.
Class Time Modules for the Semester Calendar Additional Senate Discussion
Expense Report Total Miles MONDAY 5 5 TUESDAY WEDNESDAY 6 6 THURSDAY FRIDAY SATURDAY 0 SUNDAY0 TOTAL 23.
LESSON 5 – Assignment Statements JAVA PROGRAMMING.
Simple Data Types Chapter Constants Revisited t Three reasons to use constants –Constant is recognizable –Compiler prevents changes in value.
The birthday calendar 2B : Unit 6 Days of the week Days of the week.
Array contiguous memory locations that have the same name and type. Note: an array may contain primitive data BUT an array is a data structure a collection.
Happy Days by Charles Fox and Norman Gimbel PowerPoint by Camille Page.
Daily Math Review September 2-6, Monday Solve the following problems with strategies and/or algorithms 5, = 9, = 3, =
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
BASIC C PROGRAMMING LANGUAGE TUTORIAL infobizzs.com.
8 th Grade Language Arts Monday, October 5, 2015 No DOL this week Far North Begin essay assessment- “Charles” Must be submitted by Friday at 9 P.M.
My Plan to Go to Around the world By: Benedict/5C.
Java Programming Language Lecture27- An Introduction.
PART OF SPEECH DEFINITION SYNONYM SENTENCE NAME TEACHER AND DATE1 WORDS OF THE WEEK.
PART OF SPEECH DEFINITION SYNONYM SENTENCE NAME TEACHER AND DATE1 WORDS OF THE WEEK.
Unit-2 Objects and Classes
Computers & Programming Languages
Java Programming Review 1
Presentation transcript:

Types A type consists of –a set of values –a set of operations on those values Types can be –primitive (atomic, non-decomposable) –composite (includes recursive types) Types can be –built-in –user-defined

Primitive types Typical primitive types –Boolean = {true,false} –Character = {…,’a’,…’z’,…’0’,…,’9’,…} –Integer = {0, 1, -1, 2, -2, … } –Float = {0.0, …, 1.0, -1.0, …, , …} Set of primitive types is language-dependent Value of primitive types typically implementation-dependent, though can be written into language spec (e.g. Java, C#)

Gotcha’s Boolean is not always a distinct type –C++ bools are really ints Character is not always a distinct type –C, C++, Java are really just (unsigned) ints Languages sometimes provide many variants on a primitive type: –Java’s Integer types: byte, short, int, long

User-defined primitives Enumerations allow programmers to create their own primitive (non- decomposable) types: –C++ enum day {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}; Monday prints as 1 –Java enum Day {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday} Monday prints as Monday methods can be attached to enumerands