BCSE101E- Computer Programming 01

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

BCSE101E- Computer Programming:

Python

Faculty Name: Dr. A. ILAVENDHAN


School of Computer Science and Engineering (SCOPE)
COURSE OBJECTIVES
1. To provide exposure to basic problem-solving techniques using computers.

2. To inculcate the art of logical thinking abilities and propose novel solutions
for real world problems through programming language constructs

COURSE OUTCOME
1. Classify various algorithmic approaches, categorize the appropriate data
representation, and demonstrate various control constructs.

2. Choose appropriate programming paradigms, interpret and handle data using


files to propose solution through reusable modules; idealize the importance of
modules and package
TOPICS TO BE DISCUSSED

1. What is programming language

2. Understanding Programming languages

3. Python and its advantages

4. Methods to executes python program (Interactive, IDE, Online method)

5. Installation and working with the above mentioned environment


What is programming language
• It is a type of written language that tells the computer what to do in order to
work.

• It is a set of commands , instructions and syntax used to create a software


program.

• A programming language is a computer language that is used by programmers


(developers) to communicate with computers.

• It is a set of instructions written in any specific language ( C, C++, Java, Python)


to perform a specific task.
Understanding programming languages
Humans Programming Languages Computers

English 010101
Tamil High level COMPILER Low level 010101
Languages Converts the HL to LL Languages
Telugu Check for syntax error 010010
Hindi 011101
Main() Assembly
Malayalam { Interpreter 011010
etc Executes the instruction and Languages
Int a=5,b=6;
Int c= a+b; gives output Machine
} Load R1, A
Assembler Load R2, B Level
Converts Low level Languages Add A,B Language
Ex: Java,C, C++,
Python etc., into Machine level language Mov C
Python and its Advantages
• Developed by Guido Van Rossum during 1980’s

• Comedy series – “ Monty Python flying circus”

• Python is a high-level, interpreted, interactive and objective oriented programming


language

• Easy to learn

• Contain less code

• It is free and open source.


Methods to executes python
program
• Interactive mode – command line /shell

• Integrated Development Environment (IDE)

• Online methods to execute the python programs


Interactive mode – command
line /shell
• Installation Procedure

• Welcome to Python.org

• Executing simple program


Integrated Development
Environment (IDE)
• Installation Procedure

• Anaconda | The World's Most Popular Data Science Platform

• Executing simple program


Online methods to execute the python
programs

• Executing simple program

• google colab

• Online Python Compiler - online editor (onlinegdb.com)


Problem solving

• Solving problems is the core of computer science

Computer Programmers are problem solvers. In order to solve a problem on a computer


you must:

• Know how to represent the information (data) describing the problem.

• Determine the steps to transform the information from one representation into
another.
Steps in Problem solving
Identify and
define the
problem

Evaluate Analyze the


the solution problem

Implement Identify the


possible
the solution solutions

Select the Plan


and solution
Steps in Problem solving
What Problem Can Be Solved By
Computer
Solving problem by computer undergo two phases:

• Phase 1:
• Organizing the problem or pre-programming phase.

• Phase 2:
• Programming phase.
PRE-PROGRAMMING PHASE
• Analyzing The Problem
• Understand and analyze the problem to determine whether it can be solved
by a computer.

• Analyze the requirements of the problem.

• Identify the following:


• Data requirement.
• Processing requirement or procedures that will be needed to solve the problem.
• The output.
PRE-PROGRAMMING PHASE
• All these requirements can be presented in a Problem Analysis Chart
(PAC)

Data Processing Output Solution


Alternatives

given in the problem List of processing Output List of ideas for the
or provided by the required or requirement. solution of
user procedures. the problem.
PRE-PROGRAMMING PHASE
• Payroll Problem
• Calculate the salary of an employee who works by hourly basis. The formula to be
used is
Salary = Hour works * Pay rate
Data Processing Output Solution Alternatives

Hours work, Salary = Hours work * payrate Salary 1. Define the hours worked
Pay rate and pay rate as constants.
∗2. Define the hours worked
and pay rate as input values.
Problem 2
• Write a Problem Analysis Chart (PAC) to find an area of a circle where area
= pi * radius * radius

Data Processing Output


radius area = 3.14 x radius x radius area
Algorithm
• Step by step procedure to solve a problem

• 'In Computer Science following notations are used to represent algorithm

• Flowchart: This is a graphical representation of computation

• Pseudo code: They usually look like English statements but have
additional qualities
Algorithm
Algorithms are not specific to any programming language

• An algorithm can be implemented in any programming language

• Use of Algorithms

– Facilitates easy development of programs

– Easy to convert it to a program

– Review is easier
Steps to Develop an Algorithm
Properties of an Algorithm
Different patterns in Algorithm

You might also like