TAILIEUCHUNG - Lecture Object oriented programming - Lecture no 11

This chapter present some background information on computers and programming languages in this optional chapter, provide a brief history of computers from the early days to present and describe the components found in today’s computers. This chapter also present a brief history of programming languages from low-level machine languages to today’s objectoriented languages. | CSC241: Object Oriented Programming Lecture No 11 Previous Lecture Overloading binary operator +, – and = operator for ThreeD class > feet; cout > inches; } void showdist() const { cout << feet << “ : ” << inches ; } }; Conversions Between Objects and Basic Types Distance(float meters) { float fltfeet = * meters; feet = int(fltfeet); inches = 12*(fltfeet-feet); } operator float() const { float fracfeet = inches/12; fracfeet += feet; return fracfeet/; } main() { float mtrs; Distance dist1 = ; cout << “dist1=“; (); mtrs = dist1; cout << “\ndist1 = “ << mtrs << “ meters\n”; Distance dist2(5, ); mtrs

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.