انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 2
أستاذ المادة احمد علي حسين الجنابي
07/10/2016 22:37:10
OBJECT ORIENTED PROGRAMMING
What is object oriented programing Last year we have explored the structure of a simple program that starts execution at main() and enables you to declare local and global variables and constants and branch your execution logic into function modules that can take parameters and return values. All this is very similar to a procedural language like C, which has no object- orientation to it. In other words, you need to learn about managing data and connecting methods to it.
The Concept of Classes and Objects Imagine you are writing a program that models a human being, like yourself. This human being needs to have an identity: a name, a date of birth, a place of birth, and a gender. The human can perform certain functions, such as talk and introduce him- or herself, among others. Now, the former information is data about the human being, whereas the latter information comprises functions as illustrated by Figure below.
To model a human, what you now need is a construct that enables you to group within it the attributes that define a human (data) and the activities a human can perform (methods that are similar to functions) using the available attributes. This construct is the class.
Organizing Code with Functions Functions give you a way to compartmentalize and organize your program’s execution logic. They enable you to split the contents of your application into logical blocks that are invoked sequentially. A function is hence a subprogram that optionally takes parameters and returns a value, and it needs to be invoked to perform its task. In this lesson you learn Function prototypes and function definition Passing parameters to functions and returning values from them
Reference arguments Overloaded function Inline function
What Is a Function Prototype? The function prototype basically tells what a function is called (the name of function), the list of parameters the function accepts (one or more parameters) and the return type of the function.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|