Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Principles of Programming: Flow charts, illustrations through ..., Study notes of Art

Pays money to the shopkeeper. Page 2. • These numbered steps are known as Algorithm. Flow Chart.

Typology: Study notes

2021/2022

Uploaded on 09/07/2022

zaafir_ij
zaafir_ij 🇦🇪

4.4

(60)

888 documents

1 / 9

Toggle sidebar

Related documents


Partial preview of the text

Download Principles of Programming: Flow charts, illustrations through ... and more Study notes Art in PDF only on Docsity! LECTURE SCHEDULE 14 Principles of Programming: Flow charts, illustrations through examples Principles of Programming • The program or set of programs in a computer that helps in processing the information is called SOFTWARE. • Software is a detailed writing of stepwise instructions for the computer to carry out the particular task efficiently and properly. • The art of writing software is called programming. • Software is an essential part of a computer. Without the software the computer will neither accept information nor give the desired result. Algorithm • A step-by-step procedure to solve the given problem is known as Algorithm. • The essential properties of Algorithm are: o It should be simple o It should be clear with no ambiguity o It should lead to a unique solution of the problem. o It should involve a finite number of steps to arrive at a solution. o It should have the capability to handle some-unexpected situations. • For example if a student wants to purchase a pen, he has to follow the following steps. Step Action 1. He has to get money from parents. 2. Come out of the House to cross the road 3. Check the vehicle movement for safe crossing. 4. When it is safe to cross the road, he crosses the road. 5. He gets into the shop. 6. Asks for a pen. 7. Selects a pen from the lot shown to him by the shopkeeper. 8. Pays money to the shopkeeper. • These numbered steps are known as Algorithm. Flow Chart • The graphical or visual representation of algorithm is called as flow chart. • The flow charts are easier to understand the flow of the solution. • Flow charts are drawn with the standard symbols accepted worldwide. • Each standard flow chart symbol represents on action to be performed such as Start or Stop, input operations Read or Write, decision making etc. Standard Flow Chart Symbols 1. Terminal (Start or Stop Symbol) 2. Input / Output 3. Processing 4. Flow Lines: These are arrow mark symbols used to connect two boxes and to indicate the direction of data or processing flow. 5. Decision Box: This is a diamond shaped box, which is used to indicate logical checking and gives decision after comparing between two or more objects (Eg. Yes or No; True or False, =, >, <, etc.) Is a > b? True False Step 1 : Start Step 2 : Read value for a (side) Step 3 : [Compute] Area = A * A Step 4 : Output Area Step 5 : Stop 4. Algorithm and flow chart to find the average of three numbers. Algorithm Flow Chart Step1 : Start Step 2 : Enter Three Numbers A, Band C Step 3 : Compute Average = (A+B+C)/3 Step 4 : Print Average Step 5 : Stop 5. Algorithm and flow chart to find the largest of two numbers. Algorithm Step1: Start Step 2: Enter two numbers A and B Step 3: Check if A is greater than B if yes go to Step 4 else go to Step 5 Step 4: Print A is greater than B Step 5: Check if B is greater than A if yes go to Step 6 else go to Step 7 Step 6: Print B is greater than A Step 7: Print A is equal to B Step 8: Stop Flow Chart 6. Algorithm and a flow chart to find the factorial of a number. Algorithm Step 1: Start Step 2: Read N Step 3: [Initialize all counters] Set FACT= 1, i = 1 Step 4: Compute Fact = Fact * I Increment i Step 5: Check if i < = N if true repeat step 4 if false go to step 6 Step 6: Print fact
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved