Lecture162 - What is an Object? Many of the newer...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 1 -- 1 Computer Science I - Martin Hardwick What is an Object? Many of the newer programming languages such as C++ are object-oriented languages that allow a programmer to design a program as a set of “objects”. An “object” is a physical or conceptual “thing” that you want to model in a program. it is defined by specifying its properties and the set of  operations that it can process it is analogous to objects in the real world Example: student information system objects: student, course, class, faculty, transcript In C++ you can define a new type of object (e.g., student) and then create instances of that type of object (e.g., Mary, Bob, Sally, Mike).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 1 -- 2 Computer Science I - Martin Hardwick Object Properties And Operations Every object has certain properties: examples: Every object has operations defined for it that allow you to manipulate it in a program each operation is a function examples: Student: name RCSid address phone Course: time location courseNumber sectionNumber Student: displayName() displayRCSid() changeAddress() changePhone() Course: registerStudent() dropStudent() courseList() changeLocation()
Background image of page 2
Lecture 1 -- 3 Computer Science I - Martin Hardwick Object Terminology Class -- the C++ implementation of an object. Member function
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

Lecture162 - What is an Object? Many of the newer...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online