0% found this document useful (0 votes)
0 views19 pages

Chapter 1 - Introduction to Programming Languages and FlowCharts

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views19 pages

Chapter 1 - Introduction to Programming Languages and FlowCharts

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Introduction to

Programming Languages
and FlowCharts
Outline

● Introduction to Programming Languages

● Introduction to Python

● Introduction to FlowCharts

● Practice with FlowCharts


Programming
Languages
Programming Languages

Figure: The ENIAC (1945)


Programming Languages

Figure: Binary 0-1 Figure: Assembly (Low Level Programming Language)


Overview Programming Languages
Definition of Programming Language

A Programming language is a set of symbols, grammars and


rules with the help of which one is able to translate algorithms
to programs that will be executed by the computer.
Introduction to Python

● Invented in the Netherlands, early 90s by Guido


van Rossum
● Open sourced from the beginning
● Scalable, object oriented and functional from the
beginning
● Easy to Learn
Introduction to Python
Syntax in Python3

- Just like when creating Word documents (with


extensions .doc, .docx) or Excel files (.xls, .xlsx), in Python, the file
extension for scripts is .py.
- Python statements are defined by line breaks and indentation.
Therefore, each line in a Python 3 file represents a single statement,
and if left empty, it will not be executed.

Correct
print(“hello world")
print(“Hello world")
Incorrect
print(“Hello world")print(“hello world")
Install Python3
Flow Charts

A flowchart is a diagram that depicts a process, system or computer


algorithm.

Figure: Pizza Figure: Development flowchart


flowchart
Flow Charts
Symbol Name Function

Start/End An oval represents start/end


point

Arrows A line is a connector that


shows relationships between
the representative shapes.

Input/Output A parallelogram represents


input or output

Process A rectangle represents a


process

Decision A diamond indicates a


decision.
Flow Charts
Read 2 numbers A, B. Returns sum of them.

Following steps:

● Step 1: Read A, B
● Step 2: Calculate Sum
● Step 3: Print Sum

For example, the flowchart shows the sum


with A=529, B=256.
Flow Charts

In a business, we encounter either profit or loss depending on the


relationship between income and cost. Develop an algorithm to determine
whether the business results in a profit or a loss and calculate the
respective value. Assume the input includes the income and cost of the
product.
Flow Charts
Flow Charts
Flow Charts - Exercises
- Login Process: Start -> Enter username and password -> Verify
information -> Successful login or failed login.

- Finding the Largest of Two Numbers: Start -> Enter two numbers -
> Compare the numbers -> Display the result -> End.

- Prime Number Check: Start -> Enter a number -> Check the
condition -> Result: Prime number or not -> End.

- Student Grading System: Check student's mark with following rules:


● Marks >= 90: Grade A
● Marks >= 75: Grade B
● Marks >= 50: Grade C
● Marks < 50: Fail
Thank you for
listening

You might also like