TAILIEUCHUNG - Lecture Data structures and other objects using C++ - Chapter 2: Object-oriented programming

This lecture is an introduction to classes, telling what classes are and how they are implemented in C++. Before this lecture, students should have a some understanding of: How an array of characters can be used as a string in C++ programming, and the meaning of the strlen and strcpy functions from . | Chapter 2 introduces Object Oriented Programming. OOP is a relatively new approach to programming which supports the creation of new data types and operations to manipulate those types. This presentation introduces OOP. Object Oriented Programming Data Structures and Other Objects Using C++ This lecture is an introduction to classes, telling what classes are and how they are implemented in C++. The introduction is basic, not covering constructors or operators that are covered in the text. The best time for this lecture is just before students read Chapter 2--perhaps as early as the second day of class. Before this lecture, students should have a some understanding of 1. How an array of characters can be used as a string in C++ programming, and 2. The meaning of the strlen and strcpy functions from . What is this Object ? There is no real answer to the question, but we’ll call it a “thinking cap”. The plan is to describe a thinking cap by telling you what actions can be done to it. This lecture will introduce you to object-oriented programming by using one example, which we'll call a "thinking cap". Using the Object’s Slots You may put a piece of paper in each of the two slots (green and red), with a sentence written on each. You may push the green button and the thinking cap will speak the sentence from the green slot’s paper. And same for the red button. The important thing about this thinking cap is that there are three actions which may happen to it. The three actions are described here. Example Here's an example of how the first action works. Messages are written on two slips of paper, and the messages are inserted in the two slots. Example That test was a breeze ! Once the messages have been inserted, either of the buttons may be pressed. When the green button is pressed, the message from the green slip of paper is spoken. Example I should study harder ! When the red button is pressed, the message from the red slip of paper is spoken. By the way, what

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.