The document discusses algorithms, flowcharts, and problem solving. It provides examples of writing pseudocode and algorithms to solve problems. It also explains the basic symbols used in flowcharts and provides examples of flowcharts. Key points include:
- Algorithms are step-by-step solutions to problems, while flowcharts show the logic visually using standard symbols.
- Pseudocode is an informal language similar to English that helps develop algorithms.
- Examples show algorithms and flowcharts for calculating grades, converting feet to centimeters, and finding the area of a rectangle.
- Standard flowchart symbols include shapes for start/end, processes, inputs/outputs, and decisions.
algorithms and flow chart overview.pdfAmanPratik11
This document discusses algorithms, flowcharts, and pseudocode. It provides examples of algorithms and flowcharts to calculate a student's grade, convert feet to centimeters, calculate the area of a rectangle, and find the roots of a quadratic equation. Algorithms are step-by-step solutions to problems, while flowcharts use graphical symbols to represent the logic and steps of an algorithm. Pseudocode is an informal language that helps develop algorithms. The document also lists common flowchart symbols and provides exercises to create algorithms and flowcharts.
This document discusses algorithms, flowcharts, and pseudocode. It provides examples of writing algorithms and creating flowcharts to solve problems like calculating a student's grade, converting feet to centimeters, and calculating the area of a rectangle. Key points covered include:
- Algorithms are step-by-step solutions to problems, while flowcharts use symbols to visually represent algorithm logic and flow.
- Pseudocode uses everyday language to describe algorithms before implementation in a programming language.
- Common flowchart symbols include rectangles, diamonds, circles, and arrows to show inputs, outputs, decisions, and flow.
- Examples demonstrate writing algorithms and creating corresponding flowcharts for simple problems like grade calculation and unit conversion.
Here are the algorithms and flowcharts for the exercises:
1. Algorithm:
Step 1: Input number 1 (N1)
Step 2: Input number 2 (N2)
Step 3: If N1 > N2 then print N1 else print N2
Flowchart:
Start → Input N1 → Input N2 → N1 > N2? → Yes → Print N1 → No → Print N2 → Stop
2. Algorithm:
Step 1: Input radius (R) of circle
Step 2: Calculate area (A) as π * R^2
Step 3: Print the area (A)
Flowchart:
Start → Input R → A =
This document discusses algorithms, flowcharts, pseudocode, and decision structures. It begins by defining algorithms and their purpose in problem solving. It then explains flowchart symbols and how to represent algorithms visually using flowcharts. Several examples are provided of writing pseudocode, detailed algorithms, and corresponding flowcharts to solve problems. The document also covers decision structures like if-then-else statements and relational operators. It provides examples of algorithms using nested if statements. Finally, it presents an example of determining an employee bonus based on overtime worked and absences.
The document discusses algorithms and flowcharts. It defines an algorithm as an ordered sequence of steps to solve a problem and notes that algorithms go through problem solving and implementation phases. Pseudocode is used to develop algorithms, which are then represented visually using flowcharts. The document outlines common flowchart symbols and provides examples of algorithms and corresponding flowcharts to calculate grades, convert between units of length, and calculate an area. It also discusses complexity analysis of algorithms in terms of time and space.
The document discusses algorithms and flowcharts, explaining that an algorithm is a sequence of steps to solve a problem and a flowchart uses symbols to represent the logic and flow of an algorithm. It provides examples of writing pseudocode algorithms for different problems and drawing corresponding flowcharts, including using decision structures like if-then-else and handling multiple conditions with nested if statements.
This document provides an introduction to computer science and programming concepts such as algorithms, flowcharts, and pseudocode. It discusses how to solve problems with computers by writing programs, and the steps involved in the program development cycle of analyzing a problem, designing an algorithm, implementing the program, and testing it. The document also explains algorithms, flowcharts which diagram algorithms using standard symbols, and pseudocode which describes algorithms in plain English. Examples of algorithms and flowcharts are provided.
This document provides an introduction to computer science and programming concepts such as algorithms, flowcharts, and pseudocode. It discusses how to solve problems with computers by writing programs, and the steps involved in the program development cycle of analyzing a problem, designing an algorithm, implementing the program, and testing it. The document also explains algorithms, flowcharts, and pseudocode as tools to plan and represent programs, and provides examples of writing algorithms and drawing flowcharts. Finally, it briefly discusses programming tools that aid software development.
An algorithm is a step-by-step process to solve a problem. It must be understandable by humans. The document provides examples of algorithms such as driving to a friend's house and grading systems. It also discusses flowcharts which use symbols to visually represent information flow in an algorithm. Examples are given to draw flowcharts for calculating rectangle area based on width and length, finding average marks of four subjects, and converting feet to centimeters.
The document discusses algorithms and flowcharts. It defines algorithms as step-by-step solutions to problems and flowcharts as graphical representations of algorithmic logic and control flow. The document provides examples of pseudocode algorithms and corresponding flowcharts for problems like calculating student grades, converting between units of measurement, and finding the roots of a quadratic equation. It also covers basic flowchart symbols and structures like IF/THEN/ELSE for modeling conditional logic.
The document discusses the program development cycle, including problem statements, algorithms, flowcharts, and their purposes. It provides examples of algorithms to find the largest of three numbers and the sum of the first five natural numbers. Flowcharts graphically represent algorithms using standard symbols like rectangles, diamonds, and arrows. While flowcharts help with communication, analysis, and documentation, they can be time-consuming for complex logic and difficult to modify.
This document discusses algorithms and provides examples of pseudocode and flowcharts. It begins by defining an algorithm as a sequence of instructions to solve a problem. It then explains that pseudocode specifies the steps of an algorithm using a structured English format without formal syntax. Examples of pseudocode are provided to find averages, squares, cubes, and largest numbers. The document also introduces flowcharts as a graphical way to represent algorithms using standard symbols like rectangles, diamonds, and arrows. Basic flowchart structures like sequence, selection, and loops are demonstrated. Overall, the document provides an overview of algorithms and shows how pseudocode and flowcharts can be used to design and visualize the logic and processes of algorithms.
The document discusses algorithms and flowcharts. It defines an algorithm as a sequence of steps to solve a problem and notes they can be expressed in various notations like pseudocode and programming languages. It then defines a flowchart as a diagram that represents an algorithm using symbolic shapes and describes the common shapes used in flowcharts like rectangles, diamonds, and arrows. Examples of flowcharts that compute sums and averages are provided.
The document discusses algorithms and flowcharts. It defines an algorithm as a finite set of steps to solve a problem and notes that algorithms can be expressed in various ways, including pseudocode and flowcharts. Pseudocode uses a language similar to programming but without specific syntax, making it readable by programmers familiar with different languages. A flowchart provides a graphical representation of an algorithm's logical flow. The document provides examples of algorithms expressed in pseudocode and represented through flowcharts, such as finding the average of two numbers and calculating the largest of several inputs. It also discusses common flowchart structures like sequence, selection, and iteration.
The document discusses algorithms and flowcharts, explaining that an algorithm is a sequence of steps to solve a problem and a flowchart uses graphical representations to show the logic and sequence of operations in an algorithm. It provides examples of writing pseudocode algorithms for different problems and drawing corresponding flowcharts to visually depict the logic and flow of the algorithms.
Pseudocode is a detailed description of an algorithm or program expressed in plain language rather than a programming language. It allows programmers to design programs at a high level before writing code. The document provides examples of pseudocode for control structures like conditionals and loops, and calculating sales tax and weekly wages. It also defines flowcharts as diagrams that show the sequence of operations to solve a problem and lists common flowchart symbols like rectangles, diamonds, and circles. Guidelines are given for drawing flowcharts and examples are provided of flowcharts to find the largest of three numbers and sum the first 50 natural numbers.
The document provides an overview of computational thinking and problem solving. It discusses key concepts like algorithms, the building blocks of algorithms including statements, state, control flow, functions. It also covers different notations for representing algorithms - pseudocode, flowcharts, programming languages. Some key aspects covered include the definition of an algorithm, properties and qualities of a good algorithm. Examples are provided for different algorithm concepts like finding the minimum/maximum value, sorting cards etc.
This document introduces algorithms and the process of program development. It defines an algorithm as a precise list of instructions that terminates after a finite number of steps to solve a problem. It discusses methods of specifying algorithms like pseudocode and flowcharts. Properties of algorithms include being finite, unambiguous, and having a defined sequence of execution and input/output. The steps of program development are stated as understanding the problem, planning instructions, coding the program, running and debugging it. Flowcharting guidelines and common symbols are provided. Sample exercises demonstrate writing programs to calculate simple formulas.
This document discusses flowcharts, which are graphical representations of algorithms or processes. It covers the overview, symbols, types, examples, and advantages/disadvantages of flowcharts. The main points are:
- Flowcharts show the logic and steps of an algorithm using standard symbols like rectangles, diamonds, and arrows. They help communicate and document processes.
- Common symbols include terminals, I/O, processes, decisions, and connectors to represent the start/end, inputs/outputs, steps, conditions, and connections.
- The three main types are sequential, selective, and iterative flowcharts depending on the control logic.
- Examples show flowcharts for addition, interest calculation, and determining even
The document discusses algorithms and flowcharts. It defines an algorithm as an ordered sequence of steps to solve a problem and notes that algorithms go through problem solving and implementation phases. Pseudocode is used to develop algorithms, which are then represented visually using flowcharts. The document outlines common flowchart symbols and provides examples of algorithms and corresponding flowcharts to calculate grades, convert between units of length, and calculate an area. It also discusses complexity analysis of algorithms in terms of time and space.
The document discusses algorithms and flowcharts, explaining that an algorithm is a sequence of steps to solve a problem and a flowchart uses symbols to represent the logic and flow of an algorithm. It provides examples of writing pseudocode algorithms for different problems and drawing corresponding flowcharts, including using decision structures like if-then-else and handling multiple conditions with nested if statements.
This document provides an introduction to computer science and programming concepts such as algorithms, flowcharts, and pseudocode. It discusses how to solve problems with computers by writing programs, and the steps involved in the program development cycle of analyzing a problem, designing an algorithm, implementing the program, and testing it. The document also explains algorithms, flowcharts which diagram algorithms using standard symbols, and pseudocode which describes algorithms in plain English. Examples of algorithms and flowcharts are provided.
This document provides an introduction to computer science and programming concepts such as algorithms, flowcharts, and pseudocode. It discusses how to solve problems with computers by writing programs, and the steps involved in the program development cycle of analyzing a problem, designing an algorithm, implementing the program, and testing it. The document also explains algorithms, flowcharts, and pseudocode as tools to plan and represent programs, and provides examples of writing algorithms and drawing flowcharts. Finally, it briefly discusses programming tools that aid software development.
An algorithm is a step-by-step process to solve a problem. It must be understandable by humans. The document provides examples of algorithms such as driving to a friend's house and grading systems. It also discusses flowcharts which use symbols to visually represent information flow in an algorithm. Examples are given to draw flowcharts for calculating rectangle area based on width and length, finding average marks of four subjects, and converting feet to centimeters.
The document discusses algorithms and flowcharts. It defines algorithms as step-by-step solutions to problems and flowcharts as graphical representations of algorithmic logic and control flow. The document provides examples of pseudocode algorithms and corresponding flowcharts for problems like calculating student grades, converting between units of measurement, and finding the roots of a quadratic equation. It also covers basic flowchart symbols and structures like IF/THEN/ELSE for modeling conditional logic.
The document discusses the program development cycle, including problem statements, algorithms, flowcharts, and their purposes. It provides examples of algorithms to find the largest of three numbers and the sum of the first five natural numbers. Flowcharts graphically represent algorithms using standard symbols like rectangles, diamonds, and arrows. While flowcharts help with communication, analysis, and documentation, they can be time-consuming for complex logic and difficult to modify.
This document discusses algorithms and provides examples of pseudocode and flowcharts. It begins by defining an algorithm as a sequence of instructions to solve a problem. It then explains that pseudocode specifies the steps of an algorithm using a structured English format without formal syntax. Examples of pseudocode are provided to find averages, squares, cubes, and largest numbers. The document also introduces flowcharts as a graphical way to represent algorithms using standard symbols like rectangles, diamonds, and arrows. Basic flowchart structures like sequence, selection, and loops are demonstrated. Overall, the document provides an overview of algorithms and shows how pseudocode and flowcharts can be used to design and visualize the logic and processes of algorithms.
The document discusses algorithms and flowcharts. It defines an algorithm as a sequence of steps to solve a problem and notes they can be expressed in various notations like pseudocode and programming languages. It then defines a flowchart as a diagram that represents an algorithm using symbolic shapes and describes the common shapes used in flowcharts like rectangles, diamonds, and arrows. Examples of flowcharts that compute sums and averages are provided.
The document discusses algorithms and flowcharts. It defines an algorithm as a finite set of steps to solve a problem and notes that algorithms can be expressed in various ways, including pseudocode and flowcharts. Pseudocode uses a language similar to programming but without specific syntax, making it readable by programmers familiar with different languages. A flowchart provides a graphical representation of an algorithm's logical flow. The document provides examples of algorithms expressed in pseudocode and represented through flowcharts, such as finding the average of two numbers and calculating the largest of several inputs. It also discusses common flowchart structures like sequence, selection, and iteration.
The document discusses algorithms and flowcharts, explaining that an algorithm is a sequence of steps to solve a problem and a flowchart uses graphical representations to show the logic and sequence of operations in an algorithm. It provides examples of writing pseudocode algorithms for different problems and drawing corresponding flowcharts to visually depict the logic and flow of the algorithms.
Pseudocode is a detailed description of an algorithm or program expressed in plain language rather than a programming language. It allows programmers to design programs at a high level before writing code. The document provides examples of pseudocode for control structures like conditionals and loops, and calculating sales tax and weekly wages. It also defines flowcharts as diagrams that show the sequence of operations to solve a problem and lists common flowchart symbols like rectangles, diamonds, and circles. Guidelines are given for drawing flowcharts and examples are provided of flowcharts to find the largest of three numbers and sum the first 50 natural numbers.
The document provides an overview of computational thinking and problem solving. It discusses key concepts like algorithms, the building blocks of algorithms including statements, state, control flow, functions. It also covers different notations for representing algorithms - pseudocode, flowcharts, programming languages. Some key aspects covered include the definition of an algorithm, properties and qualities of a good algorithm. Examples are provided for different algorithm concepts like finding the minimum/maximum value, sorting cards etc.
This document introduces algorithms and the process of program development. It defines an algorithm as a precise list of instructions that terminates after a finite number of steps to solve a problem. It discusses methods of specifying algorithms like pseudocode and flowcharts. Properties of algorithms include being finite, unambiguous, and having a defined sequence of execution and input/output. The steps of program development are stated as understanding the problem, planning instructions, coding the program, running and debugging it. Flowcharting guidelines and common symbols are provided. Sample exercises demonstrate writing programs to calculate simple formulas.
This document discusses flowcharts, which are graphical representations of algorithms or processes. It covers the overview, symbols, types, examples, and advantages/disadvantages of flowcharts. The main points are:
- Flowcharts show the logic and steps of an algorithm using standard symbols like rectangles, diamonds, and arrows. They help communicate and document processes.
- Common symbols include terminals, I/O, processes, decisions, and connectors to represent the start/end, inputs/outputs, steps, conditions, and connections.
- The three main types are sequential, selective, and iterative flowcharts depending on the control logic.
- Examples show flowcharts for addition, interest calculation, and determining even
This document provides information about Crystal Reports .NET, including that it is included in Visual Studio .NET editions, it provides a powerful way to create interactive reports, it has an object model for flexibility, and customizable viewers. It also describes new features like being integrated into the .NET IDE, two report viewers, allowing user interaction, ADO.NET integration, and exposing reports as web services. The document then provides steps for creating a sample employee table report in ASP.NET using Crystal Reports.
Here are two lines summarizing each key point about applications of computers:
In School - Computers are used for learning, research, and administrative tasks in schools.
At Homes - Computers allow people to work, play games, stream media, and connect with others at home.
For Medical Purpose - Computers help with patient records, imaging, simulations for training, and monitoring in hospitals.
In Entertainment - Computers power video games, movies, music, and virtual reality for entertainment.
In Science and Technology - Scientists and engineers use computers for modeling, simulation, and research across many fields.
In Designing - Designers utilize computers for drafting, rendering, modeling, and creating blueprints for
A computer is a programmable electronic device that accepts raw data as input and processes it according to programmed instructions to produce output. It consists of hardware components like the CPU, memory, and storage that perform logical and arithmetic operations on data, as well as software programs and operating systems. The basic components of a computer are the input unit, memory unit, central processing unit, and output unit, which work together in a continuous loop of input, processing, and output via the IPO cycle.
ELectronics Boards & Product Testing_Shiju.pdfShiju Jacob
This presentation provides a high level insight about DFT analysis and test coverage calculation, finalizing test strategy, and types of tests at different levels of the product.
Sorting Order and Stability in Sorting.
Concept of Internal and External Sorting.
Bubble Sort,
Insertion Sort,
Selection Sort,
Quick Sort and
Merge Sort,
Radix Sort, and
Shell Sort,
External Sorting, Time complexity analysis of Sorting Algorithms.
We introduce the Gaussian process (GP) modeling module developed within the UQLab software framework. The novel design of the GP-module aims at providing seamless integration of GP modeling into any uncertainty quantification workflow, as well as a standalone surrogate modeling tool. We first briefly present the key mathematical tools on the basis of GP modeling (a.k.a. Kriging), as well as the associated theoretical and computational framework. We then provide an extensive overview of the available features of the software and demonstrate its flexibility and user-friendliness. Finally, we showcase the usage and the performance of the software on several applications borrowed from different fields of engineering. These include a basic surrogate of a well-known analytical benchmark function; a hierarchical Kriging example applied to wind turbine aero-servo-elastic simulations and a more complex geotechnical example that requires a non-stationary, user-defined correlation function. The GP-module, like the rest of the scientific code that is shipped with UQLab, is open source (BSD license).
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYijscai
With the increased use of Artificial Intelligence (AI) in malware analysis there is also an increased need to
understand the decisions models make when identifying malicious artifacts. Explainable AI (XAI) becomes
the answer to interpreting the decision-making process that AI malware analysis models use to determine
malicious benign samples to gain trust that in a production environment, the system is able to catch
malware. With any cyber innovation brings a new set of challenges and literature soon came out about XAI
as a new attack vector. Adversarial XAI (AdvXAI) is a relatively new concept but with AI applications in
many sectors, it is crucial to quickly respond to the attack surface that it creates. This paper seeks to
conceptualize a theoretical framework focused on addressing AdvXAI in malware analysis in an effort to
balance explainability with security. Following this framework, designing a machine with an AI malware
detection and analysis model will ensure that it can effectively analyze malware, explain how it came to its
decision, and be built securely to avoid adversarial attacks and manipulations. The framework focuses on
choosing malware datasets to train the model, choosing the AI model, choosing an XAI technique,
implementing AdvXAI defensive measures, and continually evaluating the model. This framework will
significantly contribute to automated malware detection and XAI efforts allowing for secure systems that
are resilient to adversarial attacks.
The Fluke 925 is a vane anemometer, a handheld device designed to measure wind speed, air flow (volume), and temperature. It features a separate sensor and display unit, allowing greater flexibility and ease of use in tight or hard-to-reach spaces. The Fluke 925 is particularly suitable for HVAC (heating, ventilation, and air conditioning) maintenance in both residential and commercial buildings, offering a durable and cost-effective solution for routine airflow diagnostics.
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxRishavKumar530754
LiDAR-Based System for Autonomous Cars
Autonomous Driving with LiDAR Tech
LiDAR Integration in Self-Driving Cars
Self-Driving Vehicles Using LiDAR
LiDAR Mapping for Driverless Cars
How to use nRF24L01 module with ArduinoCircuitDigest
Learn how to wirelessly transmit sensor data using nRF24L01 and Arduino Uno. A simple project demonstrating real-time communication with DHT11 and OLED display.
☁️ GDG Cloud Munich: Build With AI Workshop - Introduction to Vertex AI! ☁️
Join us for an exciting #BuildWithAi workshop on the 28th of April, 2025 at the Google Office in Munich!
Dive into the world of AI with our "Introduction to Vertex AI" session, presented by Google Cloud expert Randy Gupta.
This paper proposes a shoulder inverse kinematics (IK) technique. Shoulder complex is comprised of the sternum, clavicle, ribs, scapula, humerus, and four joints.
2. ALGORITHMS AND FLOWCHARTS
A typical programming task can be divided into
two phases:
Problem solving phase
produce an ordered sequence of steps that describe
solution of problem
this sequence of steps is called an algorithm
Implementation phase
implement the program in some programming
language
3. Steps in Problem Solving
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.
Pseudocode is an artificial and informal
language that helps programmers develop
algorithms. Pseudocode is very similar to
everyday English.
4. Pseudocode & Algorithm
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.
5. Pseudocode & Algorithm
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”
7. The Flowchart
(Dictionary) A schematic representation of a sequence of
operations, as in a manufacturing process or computer
program.
(Technical) A graphical representation of the sequence
of operations in an information system or program.
Information system flowcharts show how data flows from source
documents through the computer to final distribution to users.
Program flowcharts show the sequence of instructions in a
single program or subroutine. Different symbols are used to
draw each type of flowchart.
8. The Flowchart
A Flowchart
shows logic of an algorithm
emphasizes individual steps and their
interconnections
e.g. control flow from one action to the next
9. Flowchart Symbols
Basic
Oval
Parallelogram
Rectangle
Diamond
Hybrid
Name Symbol Use in Flowchart
Denotes the beginning or end of the program
Denotes an input operation
Denotes an output operation
Denotes a decision (or branch) to be made.
The program should continue along one of
two routes. (e.g. IF/THEN/ELSE)
Denotes a process to be carried out
e.g. addition, subtraction, division etc.
Flow line Denotes the direction of logic flow in the program
10. Example
PRINT
“PASS”
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
START
Input
M1,M2,M3,M4
GRADE(M1+M2+M3+M4)/4
IS
GRADE<50
PRINT
“FAIL”
STOP
Y
N
11. Example 2
Write an algorithm and draw a flowchart 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)
13. Example 3
Write an algorithm and draw a flowchart that
will read the two sides of a rectangle and
calculate its area.
Pseudocode
Input the width (W) and Length (L) of a rectangle
Calculate the area (A) by multiplying L with W
Print A
14. Example 3
Algorithm
Step 1: Input W,L
Step 2: A L x W
Step 3: Print A
START
Input
W, L
A L x W
Print
A
STOP
15. Principles of Programming - NI July
2005 15
Flowcharts
Flowcharts is a graph used to depict or show a
step by step solution using symbols which
represent a task.
The symbols used consist of geometrical shapes
that are connected by flow lines.
It is an alternative to pseudocoding; whereas a
pseudocode description is verbal, a flowchart is
graphical in nature.
16. Principles of Programming - NI July
2005 16
Flowchart Symbols
Terminal symbol - indicates the beginning and
end points of an algorithm.
Process symbol - shows an instruction other than
input, output or selection.
Input-output symbol - shows an input or an output
operation.
Disk storage I/O symbol - indicates input from or output to
disk storage.
Printer output symbol - shows hardcopy printer
output.
17. Principles of Programming - NI July
2005 17
Flowchart Symbols cont…
Selection symbol - shows a selection process
for two-way selection.
Off-page connector - provides continuation of a
logical path on another page.
On-page connector - provides continuation
of logical path at another point in the same
page.
Flow lines - indicate the logical sequence of
execution steps in the algorithm.
18. Principles of Programming - NI July
2005 18
Flowchart – sequence control structure
Statement 2
Statement 1
Statement 3
:
19. Principles of Programming - NI July
2005 19
Flowchart – selection control structure
Condition
else-
statement(s)
then-
statement(s)
Yes
No
20. Principles of Programming - NI July
2005 20
Flowchart – repetition control structure
Condition
Loop
Statement(s)
yes
no
21. Principles of Programming - NI July
2005 21
Flowchart – example 1
Begin
Read birth date
Calculate
Age = current year – birth date
Display
age
End
22. Principles of Programming - NI July
2005 22
Flowchart – example 2
Begin
Read age
End
Age > 55? NO
YES
print “Pencen” print “Kerja lagi”
23. Principles of Programming - NI July
2005 23
Flowchart – example 5
Begin
End
current_number <= 10?
NO
YES
sum = 0
current_number = 1
sum = sum + current_number
current_number = current_number + 1
print sum
24. Example 4
Write an algorithm and draw a flowchart 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
0
ax bx c
2
4
b ac
27. Exercises: Algorithm &
Flowchart
3.) Create an algorithm and a flowchart that
will compute the sum of two numbers. If
the sum is below or equal to twenty, two
numbers will be entered again. If the sum
is above 20, it will display the sum.
28. Lab Activity: Algorithm &
Flowchart
4) Create an algorithm and a flowchart that
will output the largest number among the
three numbers.
29. Assignment 1
1. Create an algorithm and a flowchart that will output for g.c.d.
2. Create an algorithm and a flowchart that will output the factorial of a
given number.
3. Create an algorithm and a flowchart that will output the Fibonacci
series up to a given number.
4. Create an algorithm and a flowchart that will output all the prime
numbers between 2 numbers.