SlideShare a Scribd company logo
1 of 18
Algorithm Development
• Algorithm is the sequence of steps to be
performed in order to solve a problem by the
computer.
Properties of Algorithm
• The given problem should be broken down
into simple and meaningful steps.
• The step should be numbered sequentially.
• The steps should be descriptive and written in
simple English.
Advantages of Algorithms
• Reduce Complexity by dividing the program
into simple and meaningful parts.
• Increase Flexibility Algorithm is written so that
the code may be written in any language.
• Ease of Understanding No need to understand
a particular programming language to
understand an algorithm.
How to write?
• Pseudocode is an artificial and informal
language that helps programmers to develop
algorithms.
– Pseudocode is very similar to everyday English.
• Two Steps to write an algorithm:-
– First produce a general algorithm (one can use pseudocode)
– Refine the algorithm successively to get step by step detailed
algorithm that is very close to a computer language.
• Example 1: Write an algorithm to determine a
student’s final grade and indicate whether it is
passing or failing. The final grade is calculated
as the average of four marks.
Example
Pseudocode:
• Input a set of 4 marks
• Calculate their average by summing and dividing by 4
• if average is below 50
Print “FAIL”
else
Print “PASS”
• Detailed Algorithm
• Step 1: Input M1,M2,M3,M4
Step 2: GRADE  (M1+M2+M3+M4)/4
Step 3: if (GRADE < 50) then
Print “FAIL”
else
Print “PASS”
endif
• Write an algorithm to convert the length in
feet to centimeter.
Pseudocode:
• Input the length in feet (Lft)
• Calculate the length in cm (Lcm) by
multiplying LFT with 30
• Print length in cm (LCM)
Algorithm
• Step 1: Input Lft
• Step 2: Lcm  Lft x 30
• Step 3: Print Lcm
• Write an algorithm that will calculate the roots of a
quadratic equation
• Hint: d = sqrt ( ), and the roots are:
x1 = (–b + d)/2a and x2 = (–b – d)/2a
2
4b ac
Pseudocode:
• Input the coefficients (a, b, c) of the quadratic
equation
• Calculate d
• Calculate x1
• Calculate x2
• Print x1 and x2
Algorithm:
• Step 1: Input a, b, c
• Step 2: d  sqrt ( )
• Step 3: x1  (–b + d) / (2 x a)
• Step 4: x2  (–b – d) / (2 x a)
• Step 5: Print x1, x2
4b b a c   
Write an algorithm that reads two values, determines the largest
value and prints the largest value with an identifying message.
ALGORITHM
Step 1: Input VALUE1, VALUE2
Step 2: if (VALUE1 > VALUE2) then
MAX  VALUE1
else
MAX  VALUE2
endif
Step 3: Print “The largest value is”, MAX
Write an algorithm that reads three numbers and prints the value of
the largest number.
Step 1: Input N1, N2, N3
Step 2: if (N1>N2) then
if (N1>N3) then
MAX  N1 [N1>N2, N1>N3]
else
MAX  N3 [N3>N1>N2]
endif
else
if (N2>N3) then
MAX  N2 [N2>N1, N2>N3]
else
MAX  N3 [N3>N2>N1]
endif
endif
Step 3: Print “The largest number is”, MAX
Example
Bonus Schedule
OVERTIME – (2/3)*ABSENT Bonus Paid
>40 hours
>30 but  40 hours
>20 but  30 hours
>10 but  20 hours
 10 hours
$50
$40
$30
$20
$10
• Step 1: Input NAME,OVERTIME,ABSENT
• Step 2: if (OVERTIME–(2/3)*ABSENT > 40) then
• PAYMENT  50
• else if (OVERTIME–(2/3)*ABSENT > 30) then
• PAYMENT  40
• else if (OVERTIME–(2/3)*ABSENT > 20) then
• PAYMENT  30
• else if (OVERTIME–(2/3)*ABSENT > 10) then
• PAYMENT 20
• else
• PAYMENT  10
• endif
• Step 3: Print “Bonus for”, NAME “is $”, PAYMENT

More Related Content

What's hot

What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?Angela DeHart
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 
File handling in Python
File handling in PythonFile handling in Python
File handling in PythonMegha V
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++Muhammad Waqas
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IMohamed Loey
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
Algorithm Design Presentation
Algorithm Design PresentationAlgorithm Design Presentation
Algorithm Design PresentationKawsar Ahmed
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 

What's hot (20)

What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Types of algorithms
Types of algorithmsTypes of algorithms
Types of algorithms
 
Binary Search
Binary SearchBinary Search
Binary Search
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Control structure
Control structureControl structure
Control structure
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Algorithm Design Presentation
Algorithm Design PresentationAlgorithm Design Presentation
Algorithm Design Presentation
 
Python recursion
Python recursionPython recursion
Python recursion
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 

Similar to Algorithm Development

Programming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cProgramming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cRaja Hamid
 
Pj01 1-computer and programming fundamentals
Pj01 1-computer and programming fundamentalsPj01 1-computer and programming fundamentals
Pj01 1-computer and programming fundamentalsSasidharaRaoMarrapu
 
Cs1123 2 comp_prog
Cs1123 2 comp_progCs1123 2 comp_prog
Cs1123 2 comp_progTAlha MAlik
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptKirti Verma
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfAmanPratik11
 
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
Lec 2 -algorithms-flowchart-and-pseudocode1.pptxLec 2 -algorithms-flowchart-and-pseudocode1.pptx
Lec 2 -algorithms-flowchart-and-pseudocode1.pptxAbdelrahmanRagab36
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESHarshJha34
 
Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++Mohamed El Desouki
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing TechniquesAppili Vamsi Krishna
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.NandiniSidana
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1rajnidhiman
 
01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptxssuser586772
 
Problem solving techniques in c language
Problem solving techniques in c languageProblem solving techniques in c language
Problem solving techniques in c languageJohn Bruslin
 

Similar to Algorithm Development (20)

3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Programming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cProgramming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of c
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
Pj01 1-computer and programming fundamentals
Pj01 1-computer and programming fundamentalsPj01 1-computer and programming fundamentals
Pj01 1-computer and programming fundamentals
 
Cs1123 2 comp_prog
Cs1123 2 comp_progCs1123 2 comp_prog
Cs1123 2 comp_prog
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
 
Programming
ProgrammingProgramming
Programming
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdf
 
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
Lec 2 -algorithms-flowchart-and-pseudocode1.pptxLec 2 -algorithms-flowchart-and-pseudocode1.pptx
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
 
UNIT-2-PPTS-DAA.ppt
UNIT-2-PPTS-DAA.pptUNIT-2-PPTS-DAA.ppt
UNIT-2-PPTS-DAA.ppt
 
Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx
 
Programming logic &practices
Programming logic &practices Programming logic &practices
Programming logic &practices
 
Problem solving techniques in c language
Problem solving techniques in c languageProblem solving techniques in c language
Problem solving techniques in c language
 

More from ALI RAZA

pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and FlowchartALI RAZA
 
Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++ALI RAZA
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to ProgrammingALI RAZA
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to ProgrammingALI RAZA
 
Array sorting
Array sortingArray sorting
Array sortingALI RAZA
 
Array programs
Array programsArray programs
Array programsALI RAZA
 
Quiz game documentary
Quiz game documentaryQuiz game documentary
Quiz game documentaryALI RAZA
 
Function pass by value,function pass by reference
Function pass by value,function pass by reference Function pass by value,function pass by reference
Function pass by value,function pass by reference ALI RAZA
 
Drug Addiction 39 Slides
Drug Addiction 39 SlidesDrug Addiction 39 Slides
Drug Addiction 39 SlidesALI RAZA
 
Drug Addiction Original 51 Slides
Drug Addiction Original 51 SlidesDrug Addiction Original 51 Slides
Drug Addiction Original 51 SlidesALI RAZA
 
Passing stuctures to function
Passing stuctures to functionPassing stuctures to function
Passing stuctures to functionALI RAZA
 
Basic general knowledge
Basic general knowledgeBasic general knowledge
Basic general knowledgeALI RAZA
 
Dil hua kirchi kirchi by mohammad iqbal shams
Dil hua kirchi kirchi by mohammad iqbal shamsDil hua kirchi kirchi by mohammad iqbal shams
Dil hua kirchi kirchi by mohammad iqbal shamsALI RAZA
 
Pathar kar-do-ankh-mein-ansu-complete
Pathar kar-do-ankh-mein-ansu-completePathar kar-do-ankh-mein-ansu-complete
Pathar kar-do-ankh-mein-ansu-completeALI RAZA
 
Husne akhlaq
Husne akhlaqHusne akhlaq
Husne akhlaqALI RAZA
 
Parts of speech sticky note definitions and examples
Parts of speech sticky note definitions and examplesParts of speech sticky note definitions and examples
Parts of speech sticky note definitions and examplesALI RAZA
 

More from ALI RAZA (20)

Structure
StructureStructure
Structure
 
Recursion
RecursionRecursion
Recursion
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and Flowchart
 
Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
Array sorting
Array sortingArray sorting
Array sorting
 
Array programs
Array programsArray programs
Array programs
 
2D-Array
2D-Array 2D-Array
2D-Array
 
Quiz game documentary
Quiz game documentaryQuiz game documentary
Quiz game documentary
 
Function pass by value,function pass by reference
Function pass by value,function pass by reference Function pass by value,function pass by reference
Function pass by value,function pass by reference
 
Drug Addiction 39 Slides
Drug Addiction 39 SlidesDrug Addiction 39 Slides
Drug Addiction 39 Slides
 
Drug Addiction Original 51 Slides
Drug Addiction Original 51 SlidesDrug Addiction Original 51 Slides
Drug Addiction Original 51 Slides
 
Passing stuctures to function
Passing stuctures to functionPassing stuctures to function
Passing stuctures to function
 
Basic general knowledge
Basic general knowledgeBasic general knowledge
Basic general knowledge
 
Dil hua kirchi kirchi by mohammad iqbal shams
Dil hua kirchi kirchi by mohammad iqbal shamsDil hua kirchi kirchi by mohammad iqbal shams
Dil hua kirchi kirchi by mohammad iqbal shams
 
Pathar kar-do-ankh-mein-ansu-complete
Pathar kar-do-ankh-mein-ansu-completePathar kar-do-ankh-mein-ansu-complete
Pathar kar-do-ankh-mein-ansu-complete
 
Husne akhlaq
Husne akhlaqHusne akhlaq
Husne akhlaq
 
Parts of speech sticky note definitions and examples
Parts of speech sticky note definitions and examplesParts of speech sticky note definitions and examples
Parts of speech sticky note definitions and examples
 
Quik tips
Quik tipsQuik tips
Quik tips
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Algorithm Development

  • 2. • Algorithm is the sequence of steps to be performed in order to solve a problem by the computer.
  • 3. Properties of Algorithm • The given problem should be broken down into simple and meaningful steps. • The step should be numbered sequentially. • The steps should be descriptive and written in simple English.
  • 4. Advantages of Algorithms • Reduce Complexity by dividing the program into simple and meaningful parts. • Increase Flexibility Algorithm is written so that the code may be written in any language. • Ease of Understanding No need to understand a particular programming language to understand an algorithm.
  • 5. How to write? • Pseudocode is an artificial and informal language that helps programmers to develop algorithms. – Pseudocode is very similar to everyday English. • Two Steps to write an algorithm:- – First produce a general algorithm (one can use pseudocode) – Refine the algorithm successively to get step by step detailed algorithm that is very close to a computer language.
  • 6. • Example 1: Write an algorithm to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks.
  • 7. Example Pseudocode: • Input a set of 4 marks • Calculate their average by summing and dividing by 4 • if average is below 50 Print “FAIL” else Print “PASS”
  • 8. • Detailed Algorithm • Step 1: Input M1,M2,M3,M4 Step 2: GRADE  (M1+M2+M3+M4)/4 Step 3: if (GRADE < 50) then Print “FAIL” else Print “PASS” endif
  • 9. • Write an algorithm to convert the length in feet to centimeter.
  • 10. Pseudocode: • Input the length in feet (Lft) • Calculate the length in cm (Lcm) by multiplying LFT with 30 • Print length in cm (LCM)
  • 11. Algorithm • Step 1: Input Lft • Step 2: Lcm  Lft x 30 • Step 3: Print Lcm
  • 12. • Write an algorithm that will calculate the roots of a quadratic equation • Hint: d = sqrt ( ), and the roots are: x1 = (–b + d)/2a and x2 = (–b – d)/2a 2 4b ac
  • 13. Pseudocode: • Input the coefficients (a, b, c) of the quadratic equation • Calculate d • Calculate x1 • Calculate x2 • Print x1 and x2
  • 14. Algorithm: • Step 1: Input a, b, c • Step 2: d  sqrt ( ) • Step 3: x1  (–b + d) / (2 x a) • Step 4: x2  (–b – d) / (2 x a) • Step 5: Print x1, x2 4b b a c   
  • 15. Write an algorithm that reads two values, determines the largest value and prints the largest value with an identifying message. ALGORITHM Step 1: Input VALUE1, VALUE2 Step 2: if (VALUE1 > VALUE2) then MAX  VALUE1 else MAX  VALUE2 endif Step 3: Print “The largest value is”, MAX
  • 16. Write an algorithm that reads three numbers and prints the value of the largest number. Step 1: Input N1, N2, N3 Step 2: if (N1>N2) then if (N1>N3) then MAX  N1 [N1>N2, N1>N3] else MAX  N3 [N3>N1>N2] endif else if (N2>N3) then MAX  N2 [N2>N1, N2>N3] else MAX  N3 [N3>N2>N1] endif endif Step 3: Print “The largest number is”, MAX
  • 17. Example Bonus Schedule OVERTIME – (2/3)*ABSENT Bonus Paid >40 hours >30 but  40 hours >20 but  30 hours >10 but  20 hours  10 hours $50 $40 $30 $20 $10
  • 18. • Step 1: Input NAME,OVERTIME,ABSENT • Step 2: if (OVERTIME–(2/3)*ABSENT > 40) then • PAYMENT  50 • else if (OVERTIME–(2/3)*ABSENT > 30) then • PAYMENT  40 • else if (OVERTIME–(2/3)*ABSENT > 20) then • PAYMENT  30 • else if (OVERTIME–(2/3)*ABSENT > 10) then • PAYMENT 20 • else • PAYMENT  10 • endif • Step 3: Print “Bonus for”, NAME “is $”, PAYMENT