Unit 2 Problem Solving Using Computer
Unit 2 Problem Solving Using Computer
Engineer
o Asking Questions
o Plan the solutions
o Design the program
o Write the code
o Test and debug
o Refine and optimize
o Document and deploy
Feasibility Analysis
Feasibility Analysis in Software Engineering is analysis to evaluate feasibility of
proposed project or system. It assesses whether a project can be completed successfully,
given the available resources, technology, and constraints. Feasibility analysis is one of
stage among important four stages of Software Project Management Process.
Following are the types of the feasibility study.
1. Technical Feasibility: In Technical Feasibility current resources both hardware
software along with required technology are analyzed/assessed to develop project.
2. Operational Feasibility: Evaluates how the project will integrate with existing
business processes and operations.
3. Economic Feasibility: In Economic Feasibility study cost and benefit of the project is
analyzed.
4. Legal Feasibility: In Legal Feasibility study project is analyzed in legality point of
view.
5. Schedule Feasibility: In Schedule Feasibility Study mainly timelines/deadlines is
analyzed for proposed project.
6. Resource Feasibility: This method evaluates if the resources needed to complete the
software project successfully are adequate and readily available.
Aim of Feasibility Study
The overall objective of the organization are covered and contributed by the system
or not.
The implementation of the system be done using current technology or not.
Can the system be integrated with the other system which are already exist
Requirement Analysis
Requirement analysis is the process of identifying, analyzing and documenting the
requirements of a software product. It ensures that all stakeholders have a clear understanding
of what the system must do and lays the foundation for the design and development process.
Following are the types of Requirements analysis.
1. Functional Requirements
Define the features, behavior, and functionality of the system.
Compiled By: (Jashmi Khadka) Computer
Engineer
2. Non-Functional Requirements
Describe system attributes such as performance, scalability, security, and usability.
3. Business Requirements
High-level goals of the system from the organization's perspective.
4. User Requirements
Requirements from the perspective of end users, often expressed in user stories.
5. System Requirements
Technical specifications for the software and hardware needed to implement the
solution.
1. Understanding Stakeholder Needs: Ensures that the end product aligns with the needs
and goals of users and stakeholders.
2. Prevents Scope Creep: Clearly defined requirements help prevent unnecessary
features or changes during development.
3. Reduces Development Errors: Early identification of requirements minimizes
misunderstandings and rework later.
4. Improves Project Planning: Accurate requirements help estimate time, cost, and
resources more effectively.
5. Enhances Quality: Clearly defined and verified requirements lead to higher-quality
software.
Algorithm
An algorithm is a finite sequence of well-defined instructions that can be used to solve a
computational problem. It provides a step-by-step procedure that convert an input into a
desired output.
Algorithms typically follow a logical structure:
Input: The algorithm receives input data.
Processing: The algorithm performs a series of operations on the input data.
Output: The algorithm produces the desired output
Advantages of Algorithms:
It is easy to understand.
An algorithm is a step-wise representation of a solution to a given problem.
In an Algorithm the problem is broken down into smaller pieces or steps hence, it is
easier for the programmer to convert it into an actual program.
Disadvantages of Algorithms:
Writing an algorithm takes a long time so it is time-consuming.
Understanding complex logic through algorithms can be very difficult.
Branching and Looping statements are difficult to show in Algorithms(imp).
Flowchart
Flowcharts are the visual representations of an algorithm or a process. Flowcharts use
symbols/shapes like arrows, rectangles, and diamonds to properly explain the sequence of
steps involved in the algorithm or process. Flowcharts have their use cases in various fields
such as software development, business process modeling, and engineering.
Symbols used in Flowchart Designs
1. Terminal/Terminator
Compiled By: (Jashmi Khadka) Computer
Engineer
The oval symbol indicates Start, Stop and Halt in a program’s logic flow. A pause/halt is
generally used in a program logic under some error conditions. Terminal is the first and
last symbols in the flowchart.
Terminal/Terminator
2. Input/Output
A parallelogram denotes any function of input/output type. Program instructions that take
input from input devices and display output on output devices are indicated with
parallelogram in a flowchart.
Input/Output
3. Action/Process
A box represents arithmetic instructions, specific action or operation that occurs as a part
of the process. All arithmetic processes such as adding, subtracting, multiplication and
division are indicated by action/process symbol.
Action/Process
4. Decision
Compiled By: (Jashmi Khadka) Computer
Engineer
Diamond symbol represents a decision point. Decision based operations such as yes/no
question or true/false are indicated by diamond in flowchart.
Decision
5. On-Page Connector/Reference
Whenever flowchart becomes complex or it spreads over more than one page, it is useful
to use connectors to avoid any confusions. On-Page Connector is represented by a small
circle
On-Page Connector/Reference
6. Flow lines
Flow lines indicate the exact sequence in which instructions are executed. Arrows represent
the direction of flow of control and relationship among different symbols of flowchart.
Flow lines
Rules For Creating a Flowchart
Compiled By: (Jashmi Khadka) Computer
Engineer
It is the implementation of the software with the The process of fixing and resolving
1.
intent of identifying the defects the defects is known as debugging.
Compiled By: (Jashmi Khadka) Computer
Engineer
Implementation
This phase involves translating software design into executable code and preparing the system for
deployment. Following activities are including in implementation phase.
a. Coding
Version Control: Managing changes to the codebase using tools like Git to ensure
collaboration and traceability.
b. Testing
c. Deployment
Evaluation
This stage assesses the software's functionality, performance, and user satisfaction to ensure it
meets requirements. Following activities are taking in evalution.
a. Validation
b. Verification
Comparing the developed system with the initial specifications to confirm correctness.
Allowing end-users to test the software in real-world scenarios and provide feedback.
d. Performance Metrics
e. Feedback Collection
Maintenance
Compiled By: (Jashmi Khadka) Computer
Engineer
After deployment, software requires ongoing maintenance to address bugs, adapt to changes, and
enhance functionality. Following are the types of the maintenance.
a. Corrective Maintenance
b. Adaptive Maintenance
c. Perfective Maintenance
d. Preventive Maintenance
Proactively identifying and resolving potential issues to ensure long-term reliability and
performance.
Implementation Evaluation Maintenance
Definition The process of building and The process of The ongoing process of
deploying a computer assessing whether the updating, debugging, and
program from design or program meets its optimizing a program after
specifications. intended purpose and deployment.
requirements.
Objective To convert requirements To determine the To ensure the program
and designs into a program's remains functional, relevant,
functional software effectiveness, and secure over time.
product. reliability, and
compliance with
requirements.
Activities Coding, integrating Performance analysis, Bug fixes, feature
Involved components, testing during usability testing, error enhancements, performance
development, and detection, and optimization, and adapting to
deploying the program. validation against new environments.
specifications.
Key Tools IDEs, version control Testing frameworks, Issue trackers, patch
systems, compilers, monitoring tools, management tools,
debugging tools. analytics, feedback performance monitoring
collection. systems.
Compiled By: (Jashmi Khadka) Computer
Engineer
1. What do you mean by Algorithm and Flowchart? Explain the C compilation process in
brief. (2013 Spring)
2. Discuss the significance of Algorithm and Flow chart in programming. Draw a flow chart
for finding greatest digit for the supplied number by the user.(2014 Fall)
3. What is the importance of documentation in programming? Write an algorithm and draw
flowchart to find and output all the roots of a quadratic equation, for non-zero coefficients.
In case of errors program should report suitable error message. (2014 Spring)
Algorithm
Step 1: Start
Step 2: Read a, b, c values
Step 3: Compute d = b2- 4ac
Step 4: if d > 0 then
o r1 = -b+ sqrt (d)/(2*a)
o r2 = -b -sqrt(d)/(2*a)
o print r1,r2 values
Step 5: Otherwise if d = 0 then
o compute r1 = -b/2a, r2=-b/2a
o print r1,r2 values
Step 6: Otherwise if d < 0 then print roots are imaginary
Step 7: Stop
Compiled By: (Jashmi Khadka) Computer
Engineer
4. What is a flowchart? Write an algorithm and draw a flowchart to display whether a number
is prime or not. (2015 Fall)
Answer in Question 5
5. Write the significance of algorithm and flowchart in programming. Draw a neat flowchart
to input a number and check it is prime number or not. (2015 Spring)
Algorithm
1. Start
2. Read Number n
3. Set the value of i=2 (Initialize variables)
4. If i<n then go to step 5 otherwise go to step 6
5. If n%i ==0 then go to step 6
Else, Increment the value of I by 1 and go to step 4.
6. If i==n then
Print “n is prime number”
Else
Print “n is not prime number”
7. Stop
FlowChart
Compiled By: (Jashmi Khadka) Computer
Engineer
6. Define the role of flowchart in efficient program maintenance which its character. Also
develop a flowchart to print the even numbers between 150 -500. (2016 Fall)
Algorithm
Step 1: start
Step 2: Set Initial value of i=150 and n=150
Step 3: if (i%2==0)
print value of I and go to step 4 else go to step 4
Step 4: Increment the Value of i=i+1 and go to step 5
Step 5: Check if(i<=500)
Go to Step 4 else go to step 6
Step 6: Stop
Compiled By: (Jashmi Khadka) Computer
Engineer
10. Write algorithm and flowchart to generate Fibonacci sequence of eight terms.(2018 Fall)
Algorithm
Step 1: START
Step 2: Declare variable n1, n2, sum, n=8, i
Step 2: Initialize variables: n1 = 0, n2 = 1, i = 2
Step 3: Read n
Step 4: Repeat this step until i <= n
sum = n1 + n2
print sum
n1 = n2
n2 = sum
i=i+1
Step 5: STOP
Compiled By: (Jashmi Khadka) Computer
Engineer
Flowchart
11. Define the role of flow chart in efficient program maintenance with its character. Also
develop a flow chart to print the Armstrong numbers (2018 Spring) 1³ + 5³ + 3³ = 153
Step 1: Start
Step 2: Declare Variable sum, temp, num
Step 3: Read num from User
Step 4: Initialize Variable sum=0 and temp=num
Step 5: Repeat Until num>
Compiled By: (Jashmi Khadka) Computer
Engineer
.0
o sum=sum + cube of last digit[(num%10)*(num%10)*(num%10)]
o num=num/10
Step 6: IF sum==temp
Print "Armstrong Number"
ELSE
Print "Not Armstrong Number"
Step 7: Stop
Flowchart
Compiled By: (Jashmi Khadka) Computer
Engineer
12. What is the role of algorithm in programming? Write down an algorithm to check if the
given numbers is prime or not. (2019 Fall)
Answer in Question 5
13. Differentiate between algorithm and flowchart. Write an algorithm and flowchart to find
the number given by user is divisible by 2,3 and 6 or not. (2019 Spring)
Algorithm
Step 1: Start
Step 2: Input: Read the number (num) from the user.
Step 3: Check divisibility by 2:
Percentage Grade
More than or equal to 85 A
Less than 85 and more than or equal to 70 B
Less than 70 and more than or equal to 55 C
Less than 55 and more than or equal to 45 D
Less than 45 and more than or equal to 32 E
Less than 32 F
16. What are the different steps in problem solving using computer? Briefly explain each
step.(2021 Fall)