Examples for Algorithm,Pseduocode,Flowchart

Similar documents
Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm

PROGRAM DESIGN TOOLS. Algorithms, Flow Charts, Pseudo codes and Decision Tables. Designed by Parul Khurana, LIECA.

INDEX. Sl. No. Programs Page No. Procedure 2. 1 To check whether person is eligible for vote or not. 2 To find the given number is even or odd 6-8

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

Lab Manual. Program Design and File Structures (P): IT-219

Flowchart & Algorithm

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

PROGRAMMING IN C AND C++:

MODULE 2: Branching and Looping

/* Area and circumference of a circle */ /*celsius to fahrenheit*/

SNS COLLEGE OF ENGINEERING

PROGRAM DESIGN TOOLS. Algorithms, Flow Charts, Pseudo codes and Decision Tables. Designed by Parul Khurana, LIECA.

Algorithms and Basics of Programming Tasks

Subject: Computer Science

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS

WYSE Academic Challenge 2002 Computer Science Test (Sectional) SOLUTION

ALGORITHMS AND FLOWCHARTS

DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY LUCKNOW. Evaluation Scheme & Syllabus. For. B.Tech. First Year (Programming for Problem Solving)

PSEUDOCODE AND FLOWCHARTS. Introduction to Programming

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

AGB 260: Agribusiness Data Literacy. Excel Basics

Flow Chart. The diagrammatic representation shows a solution to a given problem.

Review Ch. 15 Spreadsheet and Worksheet Basics. 2010, 2006 South-Western, Cengage Learning

PESIT Bangalore South Campus Hosur Road (1km before Electronic City), Bengaluru Department of Basic Science and Humanities

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

Decimal Binary Conversion Decimal Binary Place Value = 13 (Base 10) becomes = 1101 (Base 2).

Practical File Answer key Class X (402)

Introduction to programming Tasks

(i) Describe in detail about the classification of computers with their features and limitations(10)

Programming and Data Structure

6 - Word Processing SW Clipboard Tab. Cut (Ctrl + X) Paste (Ctrl + V) Copy (Ctrl + C) Format Painter (Ctrl + Shift + C, Ctrl + Shift + V) Tab Types

***********PYTHON PROGRAMS FOR CLASS XI ******************** """ Program to Calculate Simple Interest """ p = eval(input("enter Principle?

CP I LAB MANUAL. Expt No 2 To Check Whether A Year Is A Leap Year Using if-else-if.

TI-89 TI-92 TI-92 Plus Voyage 200. Quadratic Formula Program. Systems of Linear Equations Program. Graph Reflection Program

Sardar Patel University S Y BSc. Computer Science CS-201 Introduction to Programming Language Effective from July-2002

TODAY This gives you today s date IF the cell is formatted as a date.

Python lab session 1

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

GCSE LINKED PAIR PILOT 4363/02 METHODS IN MATHEMATICS UNIT 1: Methods (Non-Calculator) HIGHER TIER

SNS COLLEGE OF ENGINEERING,

Problem solving 1. Chapter 1 PROBLEM SOLVING

VALLIAMMAI ENGINEERING COLLEGE

Class 8 ALGORITHMS AND FLOWCHARTS. The City School

Effective use of functions for F5-F9 CBEs

Excel shortcut and function keys

1996 ILLINOIS JETS TEAMS DISTRICT COMPUTER FUNDAMENTALS TEST. 1. A computer program is:

FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT III. 2 Marks PROBLEM SOLVING AND OFFICE AUTOMATION

INDEX INTRODUCTION TO EXCEL... 3 OVERVIEW OF EXCEL... 4 OFFICE BUTTON... 5

Chapter 1: Number and Operations

Unit 1: Algorithmic problem solving 1

Unit 2: Accentuate the Negative Name:

Questions Bank. 14) State any four advantages of using flow-chart

Quick Reference: Microsoft Excel Keyboard Shortcuts

Florida Math 0018 Correlation of the ALEKS course Florida Math 0018 to the Florida Mathematics Competencies - Lower

February Regional Geometry Team: Question #1

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS DEPARTMENT OF SCIENCE AND HUMANITIES EVEN SEMESTER FEB 2017

Downloaded from

Concepts Review. 2. A program is the implementation of an algorithm in a particular computer language, like C and C++.

Algorithm. Building blocks of algorithm

Programs for Computational Mathematics I Practical (PROLOG)

Computer science 10 th

Cambridge International Examinations Cambridge Ordinary Level

1. General Computer Questions

Step-by. A Very Warm Welcome to the Exciting World of Computers. Let s get Started It s easy with my Step- Instructions

MICROSOFT EXCEL TUTORIAL

Functional Skills. Level 2. Spreadsheets Learning Resource 2010 Version Task 4

P.E.S. INSTITUTE OF TECHNOLOGY BANGALORE SOUTH CAMPUS 1 ST INTERNAL ASSESMENT TEST (SCEME AND SOLUTIONS)

ANNA UNIVERSITY: CHENNAI B.E./B.Tech. DEGREE EXAMINATIONS, JAN Regulations First Semester (Common to All Branches )

CS 199 Computer Programming. Spring 2018 Lecture 2 Problem Solving

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

Assignment: 1. (Unit-1 Flowchart and Algorithm)

Cambridge International Examinations CambridgeOrdinaryLevel

Tribhuvan University Institute of Science and Technology 2065

Recursion. COMS W1007 Introduction to Computer Science. Christopher Conway 26 June 2003

1. Use the Trapezium Rule with five ordinates to find an approximate value for the integral

Object Oriented Programming Using C++ Mathematics & Computing IET, Katunayake

CMPE Experiment 3 Selective Structures

1. Find f(1), f(2), f(3), and f(4) if f(n) is defined recursively by f(0) = 1 and for n = 0, 1, 2,

OOP ASSIGNMENT -1 GROUP -1. Dhananjeyan.J. Balakumaran.M. Sivaram. S.E. Tamilarasan.T GROUP-2. Hariharan.R. Visnu.S. Daniel Napolen.

For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit

The New York Society Library Presents:

Concept of Curve Fitting Difference with Interpolation

The Hyderabad Public School, Begumpet, Hyderabad, A.P

2.6 BOOLEAN FUNCTIONS

Unit 7 Number System and Bases. 7.1 Number System. 7.2 Binary Numbers. 7.3 Adding and Subtracting Binary Numbers. 7.4 Multiplying Binary Numbers

5.3 Recursive definitions and structural induction

AQA Decision 1 Algorithms. Section 1: Communicating an algorithm

DECIMAL FRACTIONS. Thus, 0.25=25/100=1/4;2.008=2008/1000=251/125.

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions

SUM - This says to add together cells F28 through F35. Notice that it will show your result is

Chapter 1. Computer Overview

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms.

C- PROGRAMMING (3:0:0) Sub code : CS1C01/CS2C01 CIE : 50%Marks Hrs/week : 03 SEE : 50%Marks SEE Hrs : 03 Hours Max. Marks: 100 Course Outcomes:

PROBLEM SOLVING AND OFFICE AUTOMATION. A Program consists of a series of instruction that a computer processes to perform the required operation.

Suggestive List of C++ Programs

Tips and Tricks for Microsoft Word 2010

TI- Nspire Testing Instructions

Question Bank (SPA SEM II)

RECURSION (CH 5) A pattern for solving algorithm design problems

Computer Science Foundation Exam. December 15, Section I A. No Calculators! Name: SSN:

Transcription:

1 Examples for,pseduocode,flowchart Example: Finding the area of a circle Step2: Read the value of r Step3: Calculate area = 3.14*r*r Step4: Print area Step5: Stop Set area READ the r COMPUTE area=3.14*r*r PRINT area stop Flowchart Find the largest among three Numbers Step2: Read the value of a, b, c

2 Step3: IF (a>b) and (a>c) THEN print a is largest ELSE IF (b>c) THEN print b is largest ELSE print c is largest Step4: Stop READ a, b, c IF (a>b) and (a>c) THEN WRITE a is largest ELSE IF (b>c) THEN WRITE b is largest ELSE WRITE c is largest ENDIF stop Flowchart

3 Finding roots of the Quadratic equation Step:1 Start Step:2 Enter the values of a,b,c Step:3 Find the value of D Using the Formula, D = b*b-4*a*c Step:4 If D is greater than or equal to zero find 2 roots root1 (-b+sqrt(d))/(2*a) root2 (-b-sqrt(d))/(2*a) Step:5 Print root1 & root2 Step:6 If D is less than zero, then print the roots Step:7 Stop are imaginary Set root1,root2 READ the value of a, b, c Find D b*b-4*a*c IF D>=0 THEN calculate root1=(-b+sqrt(d))/(2*a) root2=(-b-sqrt(d))/(2*a) ELSE Roots are imaginary END IF WRITE root1,root2 Stop Flow chart

4 Swapping two variables Step2: Read the value of a, b Step3: c = a a = b b = c Step4: Print the value of a and b Step5: Stop READ the value of a, b To swap use c = a a = b b = c WRITE a, b stop

5 Flowchart Swapping two variables without using another variable Step2: Read the value of a, b Step3: a = a + b b = a - b a = a - b Step4: Print the value of a and b Step5: Stop READ the value of a, b To swap use a = a + b b = a - b a = a - b WRITE a, b stop

6 Flowchart Finding the year is leap year or not Step2: Read the value of year Step3: IF year % 4 ==0 THEN print It is a Leap year ELSE print It is not a Leap year Step4: Stop READ year IF year % 4 ==0 THEN WRITE It is a Leap year ELSE WRITE It is not a Leap year ENDIF stop

7 Flowchart Finding the Factorial Step2: Read the value of n and set i =1 Step3: While i <= n do fact =fact * i i = i + 1 else Goto step5 Step4: Goto step 3 Step5: print the value of fact Step6: Stop READ the value of n and set i =1

8 WHILE (i <= n) do fact =fact * i i = i + 1 ENDWHILE Repeat the loop until condition fails WRITE fact stop Flowchart Finding the Sum of the digits Step2: Read the value of n and set i = 0, sum = 0 Step3: While n>0 do r=n%10 sum=sum + r n=n/10 else Goto step5 Step4: Goto step 3 Step5: print the value of sum Step6: Stop

9 READ the value of n and set i =0, sum=0 WHILE (n>0) do r=n%10 sum=sum + r n=n/10 ENDWHILE Repeat the loop until condition fails WRITE sum stop Finding the Sum of the digits

10 Step2: Read the value of n and set i = 0, sum = 0 Step3: While n>0 do r=n%10 sum=sum + r n=n/10 else Goto step5 Step4: Goto step 3 Step5: print the value of sum Step6: Stop READ the value of n and set i =0, sum=0 WHILE (n>0) do r=n%10 sum=sum + r n=n/10 ENDWHILE Repeat the loop until condition fails WRITE sum Stop

11 Finding the Reverse of a Number Step2: Read the value of n and set i = 0, sum = 0 Step3: While n>0 do r=n%10 sum=sum *10 + r n=n/10 else Goto step5

12 Step4: Goto step 3 Step5: print the value of sum Step6: Stop READ the value of n and set i =0, sum=0 WHILE (n>0) do r=n%10 sum=sum *10 + r n=n/10 ENDWHILE Repeat the loop until condition fails WRITE sum Stop

13 Armstrong Number Example: 153 13 +53 + 33 =153 Finding an Armstrong Number Step2: Read the value of n and set a = n, sum = 0 Step3: While n>0 do r=n%10 sum=sum + r*r*r

14 n=n/10 else Goto step5 Step4: Goto step 3 Step5: If a = sum then Print Armstrong Number Else Print It is Not an Armstrong Number Endif Step6: Stop READ the value of n and set a =n, sum=0 WHILE (n>0) do r=n%10 sum=sum + r*r*r n=n/10 ENDWHILE Repeat the loop until condition fails IF a=sum THEN WRITE Armstrong Number ELSE WRITE It is not an Armstrong Number ENDIF stop

15 Fibonacci series Example: 0 1 1 2 3 5 8 11. Finding the Fibonacci series Step2: Read the value of n and set f=0,f1=-1, f2=1 Step3: While (f<n) do

16 f=f1+f2 f1=f2 f2=f Print f else Goto step5 Step4: Goto step 3 Step5: Stop READ the value of n and set f=0,f1=-1, f2=1 WHILE (f<n) do f=f1+f2 f1=f2 f2=f WRITE f ENDWHILE Repeat the loop until condition fails Stop

17 Conversion of Celsius to Fahrenheit Step2: Read the value of Celsius Step3: Fahrenheit = (1.8* Celsius) + 32 Step4: Print Fahrenheit Step5: Stop Set Fahrenheit READ the Celsius COMPUTE Fahrenheit = (1.8* Celsius) + 32 PRINT Fahrenheit Stop

18 Conversion of Fahrenheit to Celsius Step2: Read the value of Fahrenheit Step3:Calculate Celsius =(Fahrenheit 32)/1.8 Step4: Print Celsius Step5: Stop Set Celsius READ the Fahrenheit COMPUTE Celsius =(Fahrenheit 32)/1.8 PRINT Celsius Stop

19 Finding the sum of odd number between 1 to n Step2: Read the value of n and set sum=0,i=1 Step3: While (i<=n) do sum=sum+i i=i+2 else Goto step5 Step4: Goto step 3 Step5: Print sum Step6: Stop READ the value of n and set sum=0,i=1

20 WHILE (i<=n) do sum=sum+i i=i+2 ENDWHILE Repeat the loop until condition fails WRITE sum Stop Conversion of Binary number to Decimal Step2: Read the value of n and set i = 0, sum = 0

21 Step3: While n>0 do r=n%10 sum=sum + r*pow(2,i) n=n/10 i=i+1 else Goto step5 Step4: Goto step 3 Step5: print the value of sum Step6: Stop READ the value of n and set i =0, sum=0 WHILE (n>0) do r=n%10 sum=sum + r*pow(2,i) n=n/10 i=i+1 ENDWHILE Repeat the loop until condition fails WRITE sum Stop

22

23 Application software Packages Application software Set of programs, which is used to perform some specific task. Example: Word processor Spreadsheet program Database program etc,. MS-Word Starting MS-Word Start Microsoft Office All Programs Microsoft Office Word Creating a New Document File New (or) ctrl+n (or) clicking the new button Opening a Document File Open (or) ctrl+o (or) clicking the open button Saving a New Document File Save (or) ctrl+s (or) clicking the save button

24 Printing a Document File Print (or) ctrl+p (or) clicking the open button Moving the Text Ctrl+X (or) clicking the cut button Copying the Text Ctrl+P (or) clicking the copy button Find and Replace Find & Replace Edit Find and Replace (or) Ctrl+F Formatting the DocumentFormat Menu (Format Font)Font size, type, colour, Subscript, Superscript, Spacing,Text Effects etc,. Bullets and Numberings Changing case

25 Borders and Shadings etc,.