上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Computational Thinking and Approach Lecture 6 Dr.Jialiang LU Jialiang.lu@situ.edu.cn
Computational Thinking and Approach Lecture 6 Dr. Jialiang LU Jialiang.lu@sjtu.edu.cn
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY GUI OBJECTS AND GRAPHICS
OBJECTS AND GRAPHICS GUI
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Outlines ·The Object of Objects 。 Simple graphics programming Using Graphical Objects Interactive Graphics ·Displaying Images ·Playing music
Outlines • The Object of Objects • Simple graphics programming • Using Graphical Objects • Interactive Graphics • Displaying Images • Playing music
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY The Object of Objects The basic idea of object-oriented programming is to view a complex system as the interaction of simpler objects. ·An object consists of -A collection of related information. -A set of operations to manipulate that information. Objects may refer to other objects. Objects interact by sending each other messages (requests for an object to perform one's operations)
The Object of Objects • The basic idea of object-oriented programming is to view a complex system as the interaction of simpler objects. • An object consists of – A collection of related information. – A set of operations to manipulate that information. • Objects may refer to other objects. • Objects interact by sending each other messages (requests for an object to perform one’s operations)
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Example:time Specification Old style ·Develop a daily time m hours =6 system - m_minutes 30 Morning-call time 6:30:00 -m_seconds =0 Lunch time 12:00:00 I hours 12 Sport time 18:00:00 -I minutes =0 -Iseconds =0 -s hours =18 -s_minutes 0 -s_seconds =0 printTime (hours,minut es,seconds)
Example: time Specification • Develop a daily time system – Morning-call time 6:30:00 – Lunch time 12:00:00 – Sport time 18:00:00 Old style – m_hours = 6 – m_minutes = 30 – m_seconds = 0 – l_hours = 12 – l_minutes = 0 – l_seconds = 0 – s_hours = 18 – s_minutes = 0 – s_seconds = 0 printTime(hours,minut es,seconds)