Introduction To PPS
Introduction To PPS
Introduction To PPS
2
COURSE OUTCOMES
To code and test a given logic in C programming language.
UNIT II
Conditional Branching and Loops: Writing and Evaluation of Conditionals
with If, If-Else, else-if ladder Switch-Case, goto, Iteration with For, While,
Do While Loops
7
CONTENTS
Introduction to Languages
History and Applications of C
Importance and Features of C
Algorithm, flowchart and Basic Structure of C
Create, Compile and Execute C program
Introduction to Python programming
Histroy and Features of Python
Applications of Python
Existing programming vs Python programming 8
INTRODUCTION TO LANGUAGES
What is Language?
9
WHAT IS LANGUAGE?
Machine language
12
Assembly Language
English like abbreviations
E.g. add overtime to base pay and store result in gross pay
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
13
High-level languages
E.g. add overtime to base pay and store result in gross pay
grossPay = basePay + overtimePay
14
HOW MANY TYPES OF APPLICATIONS
POSSIBLE USING COMPUTER
LANGUAGE
Standalone applications
Must be installed in computer
Compatible for single operating System
15
WHAT IS C
16
It is an amazing and simple language that helps us
18
HISTORY
The root of all modern languages is ALGOL (introduced in
1960s).
ALGOL uses a structured programming.
ALGOL is popular in Europe.
In 1967, Martin Richards developed a language called
BCPL
(Basic Combined Programming Language).
Primarily BCPL is developed for system software.
In 1970, Ken Thompson created a new language called B
B is created for UNIX os at Bell Laboratories.
Both BCPL and B were “typeless” languages. 19
In 1972 Dennis Ritchie at Bell Labs wrote C and in 1978 the
publication of The C Programming Language by
Kernighan & Ritchie caused a revolution in the computing
world.
20
HISTORY
21
APPLICATIONS OF C
22
APPLICATIONS OF C
23
WHY C STILL USEFULL?
C provides:
24
Gateway for other professional languages like C C++ Java
C is used:
25
IMPORTANCE OF ‘C’
26
IMPORTANCE OF ‘C’
Rich set of built-in functions
C is highly portable.
FEATURES OF C
28
FEATURES OF C
29
Portability – It refers to the usability of the same fragment of
code in different environments. C programs are capable of being
written on one platform and being run on another with or without
any modification.
interpreter based.
30
A compiler considers the entire program as input and thereby
generates an output file with the object code whereas an
interpreter takes instruction by instruction as input and then
generates an output but does not generate a file
Simple and efficient – The syntax style is easy to comprehend.
We can use C to design applications that were previously
designed by assembly language.
33
COMPUTER SOFTWARES
Software is a set of programs, which is designed to perform a
well-defined function. A program is a sequence of
instructions written to solve a particular problem.
34
SYSTEM SOFTWARE
The system software is a collection of programs designed to
operate, control, and extend the processing capabilities of the
computer itself.
System software is generally prepared by the computer
manufacturers.
These software products comprise of programs written in low-
level languages, which interact with the hardware at a very basic
level.
System software serves as the interface between the hardware
and the end users.
Some examples of system software are Operating System,
Compilers, Interpreter, Assemblers, etc.
35
FEATURES OF A SYSTEM SOFTWARE
36
UTILITY SOFTWARE
Utility software is part of the system software and
performs specific tasks to keep the computer running.
Utility software is always running in the background.
Examples of utility software are security and optimization
programs.
39
EXAMPLES OF APPLICATION SOFTWARE
40
ALGORITHM
An algorithm is a mathematical process to solve a problem using a
finite number of steps.
Properties of Algorithms
Input -An algorithm has input values from a specified set.
finite (but perhaps large) number of steps for any input in the set.
Effectiveness -It must be possible to perform each step of an
of the desired form, not just for a particular set of input values. 41
ALGORITHM : ADDITION OF TWO NUMBERS
Step 1 : Start
Step 2 : Declare variables num1, num2 and sum.
Step 3 : Read values num1 and num2.
Step 4 : Add num1 and num2 and assign the result to sum.
sum←num1+num2
Step 5 : Display sum
Step 6 : Stop
42
FLOWCHART
43
FLOWCHART : ADDITION OF TWO NUMBERS
44
BASIC STRUCTURE OF C
45
BASIC STRUCTURE OF C PROGRAM
46
SIMPLE C PROGRAM
/* A first C Program*/
#include <stdio.h>
void main()
{
printf("Hello World \n");
}
47
DEVELOPMENT WITH C
Four stages
49
COMPILATION AND EXECUTION IN C
Compilation
Source Language
Code Compiler EXE
Execution
Native Code
50
CREATING, COMPILING AND EXECUTING
A PROGRAM
51
INTRODUCTION TO PYTHON
What is PYTHON?
Python is a high-level, interpreted, interactive and object-oriented,
scripting language.
Python is a high-level
It is a language that enables a programmer to write programs that
are more or less independent of a particular type of computer.
Such languages are considered as closer to human languages and
further from machine languages.
52
Python is Interpreted
Python is processed at runtime by the interpreter. We do not
need to compile our program before executing it. This is similar
to PERL and PHP.
Python is Interactive
You can actually sit at a Python prompt and interact with the
Interpreter directly to write your programs.
Python is Object-Oriented
Python is an object-oriented language .It allows us to develop
applications using an Object-Oriented approach. In Python, we
can easily create and use classes and objects. 53
Python is scripting language
A scripting language is used to write scripts. These contain a
series of commands that are interpreted one by one at runtime
unlike programming languages that are compiled first before
running
54
Scripting language based applications are run by interpreter.
Scripting language based applications are not required explicit compilation
Ex: shellscript, python , perl, Ruby, PowerShell
These languages are run by interpreter.
57
FEATURES OF PYTHON PROGRAMMING
Dynamically Typed
Easy
Easy to code
Python is very easy to code. Compared to other popular languages
like Java and C++ . Anyone can learn python syntax in just few hours.
Easy to read
Being a high-level language, Python code is quite like English.
Looking at it, we can tell what the code is supposed to do.
Free and Open-Source
Firstly, Python is freely available. You can download it from the
following link https://www.python.org/downloads/.
Portable
We can take one code and run it on any machine, there is no need to
write different code for different machines. This makes Python a
portable language. However, we must avoid any system-dependent
features in this case.
60
Interpreted
If we’re any familiar with languages like C++ or Java, we must first
compile it, and then run it. But in Python, there is no need to
compile it. Internally, its source code is converted into an immediate
form called bytecode.
61
Object-Oriented
Python allows us to develop applications using an Object-Oriented
approach.
Dynamically Typed
Python is dynamically-typed. This means that the type for a value is decided
at runtime, not in advance. This is why we don’t need to specify the type of
data while declaring it.
64
PYTHON APPLICATIONS
Web Applications
Business Applications
3D CAD Applications
65
Enterprise Applications
Web Applications
We can use Python to develop web applications. It provides libraries to
handle internet protocols, HTML and XML, JSON, Email processing,
request, beautifulSoup, Feedparser etc.
It also provides Frameworks such as Django, Pyramid, Flask etc to
design and develop web based applications. Some important
developments are: PythonWikiEngines, Pocoo, PythonBlogSoftware
etc.
Desktop GUI Applications
Python provides Tk GUI library to develop user interface in python
based application.
Some other useful toolkits wxWidgets, Kivy, pyqt that are useable on
66
several platforms. The Kivy is popular for writing multitouch
applications.
Software Development
Python is helpful for software development process. It works as a support
language and can be used for build control and management, testing etc.
Scientific and Numeric
Python is popular and widely used in scientific and numeric computing.
Some useful library and package are SciPy, numpy, Pandas, IPython etc.
SciPy is group of packages of engineering, science and mathematics.
Business Applications
Python is used to build Business applications like ERP and e-commerce
systems.
Tryton is a high level application platform.
Console Based Application
We can use Python to develop console based applications. 67
3D CAD Applications
To create CAD application Fandango is a real application which provides full
features of CAD.
Enterprise Applications
Python can be used to create applications which can be used within an Enterprise
or an Organization.
Some real time applications are: OpenErp, Tryton, Picalo etc.
70
ADVANTAGES OF PYTHON
Freeware: Python is open source language. It doesn't require any activation
key or subscription to work on it. It is free to use software and all the tools
available on python are absolutely free.
Less Coding: The syntax written in python is very simple and use common
English language which makes it more user-friendly.
Portability: Python can be run on any operating system. Also, we use the
Python Code written on one system onto another system without making any
changes to the code 71
EXISTING PROGRAMMING VS PYTHON PROGRAMMING
Reference Books
The C Programming Language, B.W. Kernighan and Dennis M.
Ritchie, Second Edition, Pearson education.
Programming with C, B. Gottfried, 3rd edition, Schaum’s outlines,
McGraw Hill Education (India) Pvt Ltd.
Programming Languages, A.B. Tucker, R.E. Noonan, TMH.
73
Programming Languages, K. C. Louden and K A Lambert., 3rd
edition, Cengage Learning.
THANK YOU
74