INTRODUCTION TO
PROGRAMMING
STRUCTURE
About Programming Concepts
What is Programming Language?
 A programming language is a computer
language programmers use to develop
software programs, scripts, or other sets
of instructions for computers to execute.
Program Structure
Algorithm
• Set of Instructions to write about the process of the program
Flow Chart
• Pictorial representation to describe the flow of the program
Programming Language
• Selection of program to develop the application
• Example : C, C++ , Java , Python
Algorithm
 An algorithm is a set of well-defined instructions in
sequence to solve a problem.
Rules for an writing an algorithm :
 Input and output should be defined precisely.
 An algorithm shouldn't include computer code.
Instead, the algorithm should be written in such a
way that it can be used in different programming
languages.
Example of Algorithm
 Write an algorithm to add two numbers entered by the
user.
 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
Flow Chart Understanding
 A flowchart is a graphical representations of
steps involved in the process of programs .
 Predefined Symbols used in Flowchart:
Example of Flowchart
Relation between Algorithm and
Program
Data Structure + Algorithm = Program
Data Structure = Time + space
Selection of Programming
Language
The programming Language selection depends on
the types of programming language and its
requirements :
1. High Level Programming Language : It is more
like human language and less like machine
language.
 Example :
BASIC, C, C++, COBOL, FORTRAN, Java, Pascal, P
erl, PHP, Python, Ruby, and Visual Basic.
What Type of Language the Python
is ??
 Object Oriented Programming
 Scripting Language
 Interpreted Language
Case - 1
 Company – XYZ - class
 Departments : HR , Marketing , accounts -
objects
 Role : HR – salary , recruitment
 Marketing : Promotion , advertising
 Accounts : administrative task of accounts
management
Case 2
 Shape – class
 Rectangle - object
 Square - object
 Triangle - object
 Data: side
 Function : area(), perimeter()
Cycle of OOPS
 Class –> Object –> Data –> Function
 Example: Automobile (class) : car ,
motorcycles , bus
 Data : wheels , engines , names
 Function : speed , velocity , distance
How Programs Run
 Programs run the source code into machine
code (.exe ) with the use of translation
software :
 Complier – high level language – machine
language
 Interpreter high level – machine level
Compiled languages (e.g. C, C++)
Interpreted programming
languages (e.g. Python, Perl)
And now for something different
... Java
Areas of Application where Python is
Used :
 Web Applications
 Desktop GUI Applications
 Software Development
 Data Analysis
 Business Applications
 Artificial Intelligence
Why Python for AI?
 Less Code
 Prebuilt Libraries
 Support
 Flexibility
Where to write and run the
program? Introduction about IDE
The ways with which we can run a Python
script.
 Interactive Mode of Python (IDLE)
 Python Shell
 IDE (PyCharm / Jupyter Notebook /
Spyder/IntelliJ )

Programming introduction

  • 1.
  • 2.
    About Programming Concepts Whatis Programming Language?  A programming language is a computer language programmers use to develop software programs, scripts, or other sets of instructions for computers to execute.
  • 3.
    Program Structure Algorithm • Setof Instructions to write about the process of the program Flow Chart • Pictorial representation to describe the flow of the program Programming Language • Selection of program to develop the application • Example : C, C++ , Java , Python
  • 4.
    Algorithm  An algorithmis a set of well-defined instructions in sequence to solve a problem. Rules for an writing an algorithm :  Input and output should be defined precisely.  An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.
  • 5.
    Example of Algorithm Write an algorithm to add two numbers entered by the user.  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
  • 6.
    Flow Chart Understanding A flowchart is a graphical representations of steps involved in the process of programs .  Predefined Symbols used in Flowchart:
  • 7.
  • 8.
    Relation between Algorithmand Program Data Structure + Algorithm = Program Data Structure = Time + space
  • 9.
    Selection of Programming Language Theprogramming Language selection depends on the types of programming language and its requirements : 1. High Level Programming Language : It is more like human language and less like machine language.  Example : BASIC, C, C++, COBOL, FORTRAN, Java, Pascal, P erl, PHP, Python, Ruby, and Visual Basic.
  • 10.
    What Type ofLanguage the Python is ??  Object Oriented Programming  Scripting Language  Interpreted Language
  • 11.
    Case - 1 Company – XYZ - class  Departments : HR , Marketing , accounts - objects  Role : HR – salary , recruitment  Marketing : Promotion , advertising  Accounts : administrative task of accounts management
  • 12.
    Case 2  Shape– class  Rectangle - object  Square - object  Triangle - object  Data: side  Function : area(), perimeter()
  • 13.
    Cycle of OOPS Class –> Object –> Data –> Function  Example: Automobile (class) : car , motorcycles , bus  Data : wheels , engines , names  Function : speed , velocity , distance
  • 14.
    How Programs Run Programs run the source code into machine code (.exe ) with the use of translation software :  Complier – high level language – machine language  Interpreter high level – machine level
  • 15.
  • 16.
  • 17.
    And now forsomething different ... Java
  • 18.
    Areas of Applicationwhere Python is Used :  Web Applications  Desktop GUI Applications  Software Development  Data Analysis  Business Applications  Artificial Intelligence
  • 19.
    Why Python forAI?  Less Code  Prebuilt Libraries  Support  Flexibility
  • 20.
    Where to writeand run the program? Introduction about IDE The ways with which we can run a Python script.  Interactive Mode of Python (IDLE)  Python Shell  IDE (PyCharm / Jupyter Notebook / Spyder/IntelliJ )