0% found this document useful (0 votes)
22 views

Programming Fundamentals Lec 1,2.3

Uploaded by

ikram09293
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Programming Fundamentals Lec 1,2.3

Uploaded by

ikram09293
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

PROGRAMMING

FUNDAMENTALS
BY
MS YOUSRA REHMAN
COURSE OUTLINE
REFERENCE MATERIALS
TABLE OF CONTENTS

• Introduction to computer
• Components of computer
• Characteristics of Computer
• What is program
• Why we need program
• Computer languages
• Language Processors: Assembler, Compiler and Interpreter
• Introduction to object oriented programming
• History of object oriented programming
1. COMPUTER

• A computer is a programmable electronic device that


takes data, perform instructed arithmetic and logical
operations, and gives the output.
2. COMPONENTS OF COMPUTER

• There are two components of computer


• Hardware
• software
SOFTWARE

• software is a collection of instructions, data, or computer programs


that are used to run machines and carry out particular activities.
SOFTWARE CONT….
HARDWARE

• The physical parts attached to a computer that form a whole computer are called
hardware or hardware components.
• There can be different types of hardware, depending on the structure.
• Some most common hardware are mouse, keyboard, monitor, printer, etc. These are the
parts that can be seen and touched by humans.
HARDWARE CONT….
3. CHARACTERISTICS OF COMPUTER

• The characteristics of the


computer system are as follows
4. WHAT IS PROGRAM

• Program is a set of instructions written in a specific programming language that a computer can
execute to perform a specific task or solve a problem
Key components of a program:
1. Syntax: The rules and structure of the programming language.
2. Logic: The sequence of operations or instructions that the program follows to complete its task.
3. Data: Information that the program processes, which could be input by the user or stored in files.
4. Control Structures: Statements that control the flow of the program, like loops, conditionals,
and function calls.
5. WHY WE NEED PROGRAM

• We need programs to automate tasks and solve problems efficiently using computers.
They allow us to control and instruct machines to perform specific functions quickly and
accurately.
• In industry, programming is essential for automating processes, which increases
efficiency and reduces human error in tasks like manufacturing, data management, and
logistics.
6.ALGORITHMS AND PSEUDOCODE

Algorithm
• An algorithm is a systematic, logical approach that provides a step-by-step procedure for
computers to solve a specific problem.
Pseudocode
• Pseudocode is a simplified version of programming codes, written in plain English
language and used to outline a program before its implementation.
ALGORITHMS AND PSEUDOCODE CONT…..
COMPUTER LANGUAGES
7. COMPUTER LANGUAGES

• Computer languages are divided as :


1. Low Level Language
2. High Level Language
1. LOW LEVEL LANGUAGE

• They are easy to understand by the computer.


• But difficult for programmers to read, write and understand.
There are of two types
1. Machine language
2. Assembly language
MACHINE LANGUAGE

• A Computer can only understand the Machine Language.


• Machine Language are written in series of 0's and 1's only. (also known as Binary digits)
• It is more difficult to understand and use by the humans.
• The processing speed is very fast. Therefore, most of Games and simulation programs are
written in machine languages.
ASSEMBLY LANGUAGE:

• Assembly Language is a symbolic programming language.


• It uses letter codes instead of binary digits.
• These letter codes are alphabetical abbreviation, known as Mnemonics
• For example- For Addition, the Mnemonics ADD may be used.
• Other examples are For Subtraction, the Mnemonics SUB, For Multiply, the
Mnemonics MULT, For Divide, the Mnemonics DIV and so on may be used.
2.HIGH LEVEL LANGUAGE

• These languages are also known as Fourth generation languages.


• They are very similar to human languages.
• Therefore, they are easy to read, write and understand for programmers.
• Some languages are C, C++, Java, Phython, PHP, Perl, Fortran, LISP, PROLOG, Pascal,
COBOL etc.
LANGUAGE PROCESSORS: ASSEMBLER, COMPILER AND
INTERPRETER

• Computer programs are generally written in high-level languages (like C++, Python, and
Java). A language processor, or language translator, is a computer program that convert
source code from one programming language to another language or to machine code
(also known as object code). They also find errors during translation
TYPES OF LANGUAGE PROCESSORS

The language processors can be any of the following three types


1. Compiler
The language processor that reads the complete source program written in high-level language as a
whole in one go and translates it into an equivalent program in machine language is called a
Compiler. Example: C, C++, C#.
2. Assembler
The Assembler is used to translate the program written in Assembly language into machine code.
The source program is an input of an assembler that contains assembly language instructions. The
output generated by the assembler is the object code or machine code understandable by the
computer.
TYPES OF LANGUAGE PROCESSORS
CONT…
3. Interpreter
The translation of a single statement of the source program into machine code is done by a
language processor and executes immediately before moving on to the next line is called an
interpreter.
INTRODUCTION TO OBJECT ORIENTED
PROGRAMMING
• Introduction to object oriented programming
• Object-oriented programming aims to implement real-world entities like inheritance, hiding,
polymorphism, etc in programming.
OOPs Concepts:
• Class
• Objects
• Data Abstraction
• Encapsulation
• Inheritance
• Polymorphism
WHY DO WE NEED OBJECT-ORIENTED
PROGRAMMING
• To make the development and maintenance of projects more effortless.
• To provide the feature of data hiding that is good for security concerns.
• We can solve real-world problems if we are using object-oriented programming.
• It ensures code reusability.
• It lets us write generic code: which will work with a range of data, so we don’t have to
write basic stuff over and over again.
DIFFERENCE BETWEEN C AND C++

c C++
C follows the procedural style programming. C++ is multi-paradigm. It supports both procedural
and object oriented.
Data is less secured in C. In C++, you can use modifiers for class members to
make it inaccessible for outside users.
C follows the top-down approach. C++ follows the bottom-up approach.
C does not support function overloading. C++ supports function overloading.
In C, scanf() and printf() are mainly used for C++ mainly uses stream cin and cout to perform input
input/output. and output operations.
C does not provide the feature of namespace. C++ supports the feature of namespace.
C does not support the inheritance. C++ supports inheritance.
WHAT IS C++

• C++ is a general purpose, case-sensitive, free-form programming language that supports


object-oriented, procedural and generic programming.
• C++ is a middle-level language, as it encapsulates both high and low level language
features.
USAGE OF C++

By the help of C++ programming language, we can develop different types of secured and
robust applications:
• Window application
• Client-Server application
• Device drivers
• Embedded firmware etc
C++ PROGRAM

1.#include <iostream>
2.using namespace std;
3.int main() {
4. cout << "Hello C++ Programming";
5. return 0;
HISTORY OF OBJECT ORIENTED PROGRAMMING

• History of C++ language is interesting to know. Here we are going to discuss brief
history of C++ language.
• C++ programming language was developed in 1980 by Bjarne Stroustrup at bell
laboratories of AT&T (American Telephone & Telegraph), located in U.S.A.
• Bjarne Stroustrup is known as the founder of C++ language.
• It was develop for adding a feature of OOP (Object Oriented Programming) in C
without significantly changing the C component.
HISTORY OF OBJECT ORIENTED
PROGRAMMING
CONT…
• C++ Developer
PROGRAMMING LANGUAGES THAT WERE
DEVELOPED BEFORE C++ LANGUAGE.
languages year Develop by
Agol 1990 International Group
BCPL 1967 Martin Richard
B 1970 Ken Thompson
Traditional C 1972 Dennis Ritchie
K & RC 1978 Kernighan & Dennis Ritchie
C++ 1980 Bjarne Stroustrup

You might also like