Object Oriented Programming - Lecture 1

Document Details

SlickLeibniz7502

Uploaded by SlickLeibniz7502

University of Haripur

2012

Tags

object oriented programming OOP programming languages computer science

Summary

These lecture notes introduce object-oriented programming (OOP) concepts, including a comparison of low-level and high-level programming languages. Topics covered include source code vs object code, language processors, and features of OOP. The notes are from the University of Haripur, Department of Information Technologies.

Full Transcript

Objected Oriented Programming INTRODUCTION TO PROGRAMMING & OOP OVERVIEW Department of Information Technologies University of Haripur Objected Oriented Programming WHAT IS A PROGRAM? A program i...

Objected Oriented Programming INTRODUCTION TO PROGRAMMING & OOP OVERVIEW Department of Information Technologies University of Haripur Objected Oriented Programming WHAT IS A PROGRAM? A program is a set of instructions given to a computer to perform a specific task. It takes input, processes it, and gives an output. Example: A calculator app that adds two numbers. Department of Information Technologies University of Haripur Objected Oriented Programming WHAT IS A PROGRAMMING LANGUAGE?  Set of words and symbols used to write a program  A programming language is a formal way to write programs that a computer can understand.  Communication between users and computers. Types of programming languages:  1️⃣Low-Level Languages (Close to hardware and far from human)  2️⃣High-Level Languages (Easier for humans to understand) Department of Information Technologies University of Haripur Objected Oriented Programming WHAT IS A PROGRAMMING LANGUAGE? Low-Level Programming High-Level Programming Languages Languages 1️⃣Machine Language Written in English-like syntax for Instructions are written in binary forms better readability. Binary code (0s and 1s). Needs a compiler or interpreter to Directly executed by the computer. run. Example: 10101101 11000011. Examples: C, C++, Java, Python. 1️⃣Procedural Languages – Focus 2️⃣Assembly Language on step-by-step instructions (C, One step higher than machine. Pascal). Uses symbols and mnemonics instead of 0s and 1s. 2️⃣Object-Oriented Languages – Needs an Assembler to convert it into Use objects & classes to model machine language. real-world scenarios (C++, Java, Example: MOV AX, 5. Python). Department of Information Technology University of Haripur Objected Oriented Programming WHAT IS A PROGRAMMING LANGUAGE? Department of Information Technologies University of Haripur Objected Oriented Programming DIFFERENCE BETWEEN LOW-LEVEL & HIGH-LEVEL LANGUAGES Low-Level Language High-Level Language Hard to learn and understand Easy to write & read Far from human language Near to human language Fast (directly executed) Slightly slower (needs translation) Used to write hardware programs Used to write Application programs Machine code, Assembly C, C++, Java, Python Department of Information Technologies University of Haripur Objected Oriented Programming TYPES OF CODES  1️⃣Source Code  Program written in high-level language  The original code written by a programmer (C++, Java, etc.).  Also known as source program  Cannot executed directly  2️⃣Object Code  The program is machine language is called object code/machine code.  The translated version that the machine can understand.  Computers understand it directly.  Example:  Source Code: cout