0% found this document useful (0 votes)
44 views6 pages

Coding in Problem Solving Steps

The document outlines the three basic steps for solving problems using computer programs: analyzing/defining the problem, designing a solution (including algorithm development and coding), and implementing the solution. It explains the importance of algorithms and pseudocode in problem-solving, along with various testing and debugging methods to ensure software reliability. Additionally, it discusses implementation methods and the concept of decomposition to manage complex systems effectively.

Uploaded by

xify
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views6 pages

Coding in Problem Solving Steps

The document outlines the three basic steps for solving problems using computer programs: analyzing/defining the problem, designing a solution (including algorithm development and coding), and implementing the solution. It explains the importance of algorithms and pseudocode in problem-solving, along with various testing and debugging methods to ensure software reliability. Additionally, it discusses implementation methods and the concept of decomposition to manage complex systems effectively.

Uploaded by

xify
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Problem Solving

There are 3 basic steps for solving any problem using computer/computer program
1. Analyse / Define problem
2. Design Solution (developing an algorithm, coding, testing and debugging)
3. Implement solution

1. Analyse / Define problem


The process of understanding the problem and then defining it on the basis of
following:
• Data requirement of the given problem
• Type of input variable required
• Type of output variable required is called problem definition
2. Design Solution
Design is a process to transform user requirements into some suitable form, which
helps the programmer in software coding and implementation. Programming tools,
program design tools are the tools used to develop a program. following are some of
them
• Algorithm
 Flowchart
 Pseudo-code
Designing an algorithm:
An algorithm is a plan, a logical step-by-step process for solving a problem.
Algorithms are normally written as a flowchart or in pseudo-code as it’s next level.
When designing an algorithm there are two main areas to look at:
• the big picture- What is the final goal?
• the individual stages– What hurdles need to be overcome on the way to the goal?
An algorithm to Find largest of two numbers
Step 1: Start
Step 2: Declare variables a,b
Step 3: Read variables a,b
Step 4: If a>b
If a>b
Display a is the largest number.
Else
Display b is the largest number
A flowchart is simply a graphical representation of steps. It shows steps in a
sequential order, and is widely used in presenting flow of algorithms, workflow or
processes. Typically, flowchart shows the steps as boxes of various kinds, and their
order by connecting them with arrows.
Flowchart Symbols
Different flowchart shapes have different conventional meanings. The meanings of
some of the more commonshapes are asfollows:

1. Terminator
The terminator symbol represents the starting or ending point of the system.

2. Process
A box indicates some particular operation.

3. Document
This represents a printout, such as a document or a report

4. Decision
A diamond represents a decision or branching point. Lines coming out from the
diamond indicates different possible situations, leading to different sub-processes.

5. Data
It represents information entering or leaving the system. An input might be an order
from a customer. An output can be a product to be delivered.

6. Flow
Lines represent flow of the sequence and direction of a process
Representation of algorithm using flowchart
E.g. Flowchart for addition of two numbers
Example- Flowchart for finding largest of two numbers

Pseudo-code
Pseudocode is not a programming language, it is a simple way of describing a set of
instructions that does not have to use specific syntax. There is no strict set of
standard notations for pseudocode, but some of the most widely recognised are:
INPUT/READ– indicates a user will be inputting something
OUTPUT/WRITE– indicates that an output will appear on the screen
WHILE–a loop (iteration that has a condition at the beginning)
FOR–a counting loop (iteration)
REPEAT– UNTIL – a loop (iteration) that has a condition at the end
IF – THEN – ELSE – a decision (selection) in which a choice is made any
instructions that occur inside a selection or iteration are usually indented
Example- Pseudocode to find out largest of two numbers
Write "please enter 2 numbers"
Read n1,n2
If(n1 > n2)
Set max to n1
Else
Set max to n2
Difference between algorithm and pseudo-code
An algorithm is a well defined sequence of steps that provides a solution for a given
problem, while a pseudocode is one of the methods that can be used to represent an
algorithm.
While algorithms can be written in natural language, pseudocode is written in a
format that is closely related to high level programming language structures.
Pseudocode does not use specific programming language syntax and therefore could
be understood by programmers who are familiar with different programming
language.
Transforming an algorithm presented in pseudocode to programming code could be
much easier than converting an algorithm written in natural language
Coding :
Coding is basically implementing logic/algorithm/pseudocode (derived from
requirement analysis/problem definition) in one of the preferred programming
language(C,C++ Java, Javascript, python etc) as per the protocols/rules/syntactic
grammar of the choosen language by following the design decisions.
Testing :
Software Testing is a method to check whether the actual software product matches
expected requirements and to ensure that software product is Defect free. Testing is
Important because if there are any bugs or errors in the software, it can be identified
early and can be solved before delivery of the software product. Properly tested
software product ensures reliability, security and high performance which further
results in time saving, cost effectiveness and customer satisfaction
Types of Software Testing
• Functional Testing
• Non-Functional Testing or Performance Testing
• Maintenance (Regression and Maintenance)
Debugging Software programs goes through testing, updating, troubleshooting, and
maintenance during the development process. Usually, software contains errors and
bugs, which are removed routinely. Debugging is the process of fixing a bug in the
software. Debugging Steps->

3. Implementation
Implementation refers to the process of adopting and integrating a software
application into a real [Link] of new tools and software into
an enterprise can be complex, depending on the size of the organization and the
software.
Implementation Methods
Parallel- When the new system is used at the same time as the old system the two
systems are said to be running in parallel.
Phased-When small parts of the new system gradually replace small parts of the old
system, the implementation method is said to be phased.
Pilot-When a small group of users within an organization uses a new system prior to
wider use, the system is said to be piloted.
Direct-When a new system is implemented without any phased or pilot
implementation
Decomposition
Decomposition also known as factoring, is breaking a complex problem or system
into parts that are easier to conceive, understand, program, and maintain.
Need for decomposing a problem: It involves breaking down a complex problem or
system into smaller parts that are more manageable and easier to understand. The
smaller parts can then be examined and solved, or designed individually, as they are
simpler to work with.
Example of Decomposition
1. Banking Transaction System

2. Library Management System


3. Payroll System

Common questions

Powered by AI

Flowcharts enhance the clarity of an algorithm's logic by providing a visual representation of the sequence of steps, which helps in better understanding the process flow. Unlike textual descriptions, flowcharts use standardized symbols to depict operations, decisions, and input-output, which clarifies the logic structure and relationships between different steps. The use of arrows to indicate step sequences helps in quickly identifying loops, branches, and dependencies, making the overall process easier to comprehend at a glance. This visual aid can assist in identifying logical errors or inefficiencies in the algorithm that might be less obvious in text .

The concept of decomposition assists in managing complex systems, such as a Banking Transaction System, by breaking down the system into smaller, more manageable parts. Each part can be understood, designed, and solved individually, making the development process simpler. This modular approach enables developers to focus on one component at a time, which not only facilitates easier maintenance and troubleshooting but also allows for parallel development and testing of different components. By simplifying the complexity, decomposition helps in clearer understanding, efficient problem resolution, and more manageable project timelines .

Having a comprehensive design solution before beginning the coding phase is crucial because it transforms user requirements into a structured format that guides the programmers in implementing the software. This includes detailed algorithms, flowcharts, and pseudocode that outline the logic, functionality, and flow of the program, ensuring consistency and coherence. A well-thought-out design prevents scope creep, reduces the likelihood of costly revisions, and helps identify potential issues early, which streamlines the coding process and ensures the final product meets the intended specifications and performance criteria .

If the problem definition is not thoroughly analyzed, challenges that could arise during the coding phase include incorrect or insufficient data requirements, leading to mismatched input-output specifications. Coding based on a flawed problem definition might result in the development of software that fails to meet user needs or contains logical errors. Additionally, inadequate problem definition can cause scope changes post-coding, requiring significant rework, which increases project time and costs. It may also mislead the algorithm design, complicating the software’s functionality and leading to inefficient or redundant code .

When deciding between phased and direct implementation methods for a new software system, factors to consider include the complexity of the system, the organizational readiness, risk management strategies, and resource availability. Phased implementation, which involves gradual integration, is preferable in situations where continuity and stability are critical, as it minimizes risk by allowing smaller, testable updates. Direct implementation, on the other hand, might be suitable for less critical or less complex systems where swift transition is necessary, despite the higher risk involved. The availability of testing and support resources, as well as user adaptability, should also guide the choice of implementation method .

Pseudocode facilitates the transformation of an algorithm into programming code by providing a format that is closely related to high-level programming language structures, yet does not use specific programming language syntax. This makes it easier for programmers, regardless of the programming language they use, to understand and implement the algorithm. Transforming an algorithm presented in pseudocode into programming code is generally more straightforward than converting an algorithm written in natural language because pseudocode explicitly outlines the logic in a linear, step-by-step manner .

Debugging improves software quality during the development process by systematically identifying and fixing bugs that could lead to incorrect or unexpected software behavior. It ensures that the program performs as intended by removing errors that compromise performance or functionality. This iterative process of detection and correction not only enhances the reliability and robustness of the software but also saves time and resources in the long run by preventing major issues from persisting into the software release stage .

Phased implementation influences the integration of new systems by gradually replacing small parts of the old system with the new one. This allows for a controlled and measured integration process, reducing the risk of system shock or significant disruption. In contrast, pilot implementation involves a small group of users testing the new system before it is rolled out more widely. This helps in identifying potential issues in a controlled environment and provides feedback that can improve the system before full implementation, thus minimizing risks and improving the quality of the final system implementation .

Software testing plays a critical role in ensuring the functionality and reliability of a software product by verifying that the software matches expected requirements and is defect-free. Testing identifies bugs and errors early, allowing them to be resolved before the final release, which enhances security and performance. Properly conducted testing contributes to software reliability, customer satisfaction, and cost-effectiveness by minimizing post-release defects and avoiding costly fixes later on. It includes functional testing to ensure correct operations, and non-functional testing for performance measures .

The essential differences between an algorithm and pseudocode in problem-solving lie in their formats and purposes. An algorithm is a well-defined sequence of steps or logical process for solving a problem, and it can be written in natural language. In contrast, pseudocode is a semi-formal language that uses plain language to describe the steps in a way that closely resembles programming code. Pseudocode is specifically designed to be easily translated into actual programming language syntax, making it more structured than a natural language description of an algorithm. While an algorithm provides an informal description, pseudocode offers a bridge to programming implementation .

You might also like