Here are the steps to solve the problems using IPO table, pseudo code and flowchart:
1. Define the problem and understand requirements
2. Make IPO table:
- Input, Process, Output
3. Write pseudo code using proper indentation and comments
4. Draw flowchart using standard symbols
5. Test and debug the program
This systematic approach helps analyze the problem, design the algorithm and implement it properly. The key is breaking down the problem into smaller understandable steps.
Introduction
The term problem solving is used in many disciplines, sometimes with different perspectives and
often with different terminologies. The problem-solving process starts with the problem
specification and end with a correct program.
The steps to follow in the problem-solving process are:
Problem definition
Problem Analysis
Algorithm development
Coding
Testing & Debugging
Documentation & Maintenance
The stages of analysis, design, programming, implementation and maintenance form the life cycle
of the system.
01 Introduction to analysis of Algorithms.pptxssuser586772
An algorithm is a set of steps of operations to solve a problem performing calculation, data processing, and automated reasoning tasks.
An algorithm is an efficient method that can be expressed within finite amount of Time and space.
The important aspects of algorithm design include creating an efficient algorithm to solve a problem in an efficient way using minimum time and space.
To solve a problem, different approaches can be followed. Some of them can be efficient with respect to time consumption, whereas other approaches may be memory efficient. To Evaluate An Algorithm we have to Satisfy the following Criteria:
INPUT: The Algorithm should be given zero or more input.
OUTPUT: At least one quantity is produced. For each input the algorithm produced value from specific task.
DEFINITENESS: Each instruction is clear and unambiguous.
FINITENESS: If we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after a finite number of steps.
EFFECTIVENESS: Every instruction must very basic so that it can be carried out, in principle, by a person using only pencil & paper.Algorithm : Systematic logical approach which is a well-defined, step-by-step procedure that allows a computer to solve a problem.
Pseudocode : It is a simpler version of a programming code in plain English which uses short phrases to write code for a program before it is implemented in a specific programming language.
Program : It is exact code written for problem following all the rules of the programming language.Algorithm can be described (Represent) in four ways.
Natural language like English:
When this way is chooses, care should be taken, we
should ensure that each & every statement is definite.
(no ambiguity)
2. Graphic representation called flowchart:
This method will work well when the algorithm is small& simple.
3. Pseudo-code Method:
In this method, we should typically describe algorithms as
program, which resembles language like Pascal & Algol
(Algorithmic Language).
4.Programming Language:
we have to use programming language to write algorithms like
C, C++,JAVA etc.Comments begin with // and continue until the end of line.
Blocks are indicated with matching braces { and }.
An identifier begins with a letter. The data types of variables are not explicitly declared.
node= record
{
data type 1 data 1;
data type n data n;
node *link;
}
4. There are two Boolean values TRUE and FALSE.
Logical Operators
AND, OR, NOT
Relational Operators
<, <=,>,>=, =, !=
1.How to create an algorithm: To create an algorithm we have following design technique
a) Divide & Conquer
b) Greedy method
c) Dynamic Programming
d) Branch & Bound
e) Backtracking
2.How to validate an algorithm:
Once an algorithm is created it is necessary to show that it computes the correct Pr
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Introduction
The term problem solving is used in many disciplines, sometimes with different perspectives and
often with different terminologies. The problem-solving process starts with the problem
specification and end with a correct program.
The steps to follow in the problem-solving process are:
Problem definition
Problem Analysis
Algorithm development
Coding
Testing & Debugging
Documentation & Maintenance
The stages of analysis, design, programming, implementation and maintenance form the life cycle
of the system.
01 Introduction to analysis of Algorithms.pptxssuser586772
An algorithm is a set of steps of operations to solve a problem performing calculation, data processing, and automated reasoning tasks.
An algorithm is an efficient method that can be expressed within finite amount of Time and space.
The important aspects of algorithm design include creating an efficient algorithm to solve a problem in an efficient way using minimum time and space.
To solve a problem, different approaches can be followed. Some of them can be efficient with respect to time consumption, whereas other approaches may be memory efficient. To Evaluate An Algorithm we have to Satisfy the following Criteria:
INPUT: The Algorithm should be given zero or more input.
OUTPUT: At least one quantity is produced. For each input the algorithm produced value from specific task.
DEFINITENESS: Each instruction is clear and unambiguous.
FINITENESS: If we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after a finite number of steps.
EFFECTIVENESS: Every instruction must very basic so that it can be carried out, in principle, by a person using only pencil & paper.Algorithm : Systematic logical approach which is a well-defined, step-by-step procedure that allows a computer to solve a problem.
Pseudocode : It is a simpler version of a programming code in plain English which uses short phrases to write code for a program before it is implemented in a specific programming language.
Program : It is exact code written for problem following all the rules of the programming language.Algorithm can be described (Represent) in four ways.
Natural language like English:
When this way is chooses, care should be taken, we
should ensure that each & every statement is definite.
(no ambiguity)
2. Graphic representation called flowchart:
This method will work well when the algorithm is small& simple.
3. Pseudo-code Method:
In this method, we should typically describe algorithms as
program, which resembles language like Pascal & Algol
(Algorithmic Language).
4.Programming Language:
we have to use programming language to write algorithms like
C, C++,JAVA etc.Comments begin with // and continue until the end of line.
Blocks are indicated with matching braces { and }.
An identifier begins with a letter. The data types of variables are not explicitly declared.
node= record
{
data type 1 data 1;
data type n data n;
node *link;
}
4. There are two Boolean values TRUE and FALSE.
Logical Operators
AND, OR, NOT
Relational Operators
<, <=,>,>=, =, !=
1.How to create an algorithm: To create an algorithm we have following design technique
a) Divide & Conquer
b) Greedy method
c) Dynamic Programming
d) Branch & Bound
e) Backtracking
2.How to validate an algorithm:
Once an algorithm is created it is necessary to show that it computes the correct Pr
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
2. Previously…
A program MUST be systematically and
properly designed before coding begins.
This design process results in the
construction of an ALGORITHM.
3. Algorithm
• There is no general definition of algorithm accepted.
• But we can say that algorithm is:
i. A step‐by‐step problem‐solving procedure.
ii. A sequence of instruction that tell how to solve a particular problem.
iii. A set of instruction for solving a problem, especially on a computer.
iv. A computable set of steps to achieve a desired result.
• However, most agree that algorithm has something to do with
defining generalized processes to get “output” from the “input”.
4. Algorithm
• Therefore, we can conclude that:
• Algorithm a step‐by‐step problem solving process in which a solution is
arrived in a finite amount of time
OR
• An algorithm is a finite list of sequential steps specifying actions that if
performed result in solution of a specific problem.
5. Algorithm & Logical Thinking
• To develop the algorithm, the programmer needs to ask:
• What data has to be fed into the computer?
• What information do I want to get out of the computer?
• Logic: Planning the processing of the program. It contains the instructions
that cause the input data to be turned into the desired output data.
6. Algorithm Representation
• There is no standard method of algorithm representation exist,
however there are commonly used are:
i. Flowchart
graphical representation of an orderly step by step solution to a problem.
ii. Pseudo code
Textual representations in English like to present the solution to a problem.
iii. Tree representation
graphical representation to break problem into sub‐problem and task
7. From Algorithm to Program
• Both are sets of instructions on how to do a task;
• Algorithm:
• talking to humans, easy to understand
• in plain (English) language
• Program:
• talking to computer (compiler)
• can be regarded as a “formal expression” of an algorithm
8. From Algorithm to Program
PROGRAM
ALGORITHM
a sequence of instructions
describing how to do a
task (or process)
a set of instructions which
are commands to computers
to perform specific
operations on data
9. Algorithm & Program
Algorithm
• A step‐by‐step problem‐solving
procedure
• A sequence of instruction that tell
how to solve a particular problem.
• A set of instruction for solving a
problem, especially on a computer.
• A computable set of steps to achieve
a desired result.
• Written in pseudo code or flowchart.
Program
• A program is a set of instructions
which are commands to computers to
perform specific operations on data.
• Instructions within a program are
organized in such a way, when the
program is run on a computer; it
results in the solution of a problem.
• Written in any programming language
10. Program Development Life Cycle
i. Problem solving phases
Consist of problem definition and algorithm design
Phase 1: Problem Definition (Analysis)
Phase 2: Algorithm design
Phase 3: Algorithm implementation
Phase 4: Program testing
Phase 5: Program maintenance
ii. Implementation phases
Consist of algorithm implementation, program
testing and program maintenance phases.
11. Phase 1: Problem Definition (Analysis)
• The problem is defined to obtain a clear understanding of the problem requirement.
• It is important before come out with the solution algorithm to do the following:
a. Analyze the problem thoroughly.
b. Understand the requirement of the problem and required solution.
c. Divide the problem into sub‐problem if the problem is complex.
• The most important and major requirement that need to be specified during problem definition (analysis):
a. Input
b. Process
c. Output
• However, to get a complete problem specification, the following questions should be asked during problem
definition (analysis):
a. What are the input data?
b. What are the output (desired) data?
c. What formula is to be used?
d. What other assumptions or constraints can be made?
e. What is the expected output screen?
12. Phase 2: Algorithm design
• The specifications derived earlier in the analysis phase are translated into
the algorithm. An algorithm is a step‐by‐step sequence of precise
instructions that must terminate and describes how the data is to be
processed to produce the desired outputs. The instruction may be
expressed in a human language.
• An algorithm must satisfy some requirements:
• Input : It must have zero or more input
• Output : It must produce at least one output.
• Definiteness : Every step in algorithm must be clear as to what it is supposed to do
and how many times it is expected to be executed.
• Effectiveness : It must be correct and efficiently solve the problem for it is designed.
• Finiteness : It must execute its instruction and terminate in a finite time.
13. Algorithm Representation
• Almost every program involves the steps of input, processing, and output.
• Therefore graphical representation are needed to separate these three
steps.
• An algorithm can be written or described or represent using several tools:
• Pseudo code
Use English‐like phrases to describe the processing process. It is not standardized
since every programmer has his or her own way of planning the algorithm.
• Flowchart
Use standardized symbol to show the steps the computer needs to take to
accomplish the program’s objective. Because flowcharts are cumbersome to revise,
they have fallen out of favor by professional programmers. Pseudo code, on the
other hand, has gained increasing acceptance.
14. Flowchart Symbol and Description
Name Symbol Description
Lozenge Indicates the starting or ending of flowchart
(start / stop : terminal )
Connector Used to connect break in the flowchart
Parallelelogram Use for input and output operation (data)
Rectangle Indicates any interval operation (process)
Diamond Use for asking questions that can have either
TRUE of FALSE / YES or NO (decision / selection)
Module Sub solution to solve a part of entire problem
Control flow Shows flow direction
15. Flowchart Logic Structure
Sequence Structure Selection Structure Loop Structure
statement
statement
DO WHILE
(test
condition)
LOOP
(statement)
DO WHILE
No
Yes
ELSE
(statement)
IF
(test
condition)
THEN
(statement)
No
Yes
16. Flowchart Example
Design an algorithm to find the area of a rectangle
The formulas: area = length * width
Input Process Output
Input variable:
length
width
Processing item:
area
Formula:
area = length x width
Step / Solution algorithm:
get input
calculate area
display output
Output:
area
Start
length, width
calculate area
area
End
18. Pseudo Code Example
Start
Read length
Read width
Calculate area of a rectangle
Display area of a rectangle
End
Design an algorithm to find the area of a rectangle
The formulas: area = length * width
Input Process Output
Input variable:
length
width
Processing item:
area
Formula:
area = length x width
Step / Solution algorithm:
get input
calculate area
display output
Output:
area
Start
Prompt the user to enter a length of a rectangle
Prompt the user to enter a width of a rectangle
Calculate the area of a rectangle
Display the area of a rectangle
End
Start
Input length
Input width
Calculate area of a rectangle
Output area of a rectangle
End
OR
OR
19. Why Algorithm is Important?
• Describe the steps needed to perform a computation
• Important for writing efficient code
• code that execute faster & which uses less memory
20. Sequence Structure
• With sequence structure, an action or event is performed in order,
one after another.
• A sequence can contain any number of events but there is no chance
to branch off and skip any of the events.
• Once you start a series of events in a sequence, you must continue
step‐by‐step until the sequence ends.
21. Sequence Example
• Problem
• Design a software to calculate the sum of two numbers entered by user.
Step 1: Program Specification
• Understand what the problem is?
• What is needed to solve it?
• What solution should provide for the problem?
• Input to the problem
• Expected output
• Any special constraints/condition/ formulas to be used
22. Sequence Example
• Problem
• Design a software to calculate the sum of two numbers entered by user.
Input Process Output
Input variable:
num1
num2
Processing item:
sum
Formula:
sum = num1 + num2
Step / Solution algorithm:
get input
calculate sum
display output
Output:
sum
23. Sequence Example
Simple Design
1. Start
2. Get input
Read num1
Read num2
3. Calculate sum
sum = num1 + num2
4. Display output
Print sum
5. End
Pseudo Code
Modular Design
1. Start
2. get_input()
3. calculate_sum()
4. display_output()
5. End
2. get_input()
Read num1
Read num2
3. calculate_sum()
sum = num1 + num2
4. display_output()
Print sum
Simple Design Modular Design
24. Sequence Example
Simple Design
Flowchart
Modular Design
Simple Design Modular Design
start
Read num1,
num2
calculate sum
Print sum
end
Start
End
calculate_sum()
get_input()
display_output()
Sub-Module
Start
Read
num1
Read
num2
Return
Start
Return
calculate sum
Start
Print sum
Return
26. Exercise
For each of the problem, analyze it using IPO table, then write the
algorithm (pseudo code and flowchart).
• Problem 1: Calculate the area of one circle.
• Problem 2: Calculate the temperature in Celsius. Temperature in
Fahrenheit will be entered. The formula is;
• Temperature in Celsius = 5/9 (temperature in Fahrenheit – 32)
• Problem 3: Calculate the final mark for a student who took CS118
paper. The final mark is the total of on-going assessment (carry mark)
and 60% of final exam. The carry mark is calculated as follow:
• Carry mark = 20% of test mark + 20% of quiz mark