Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

Problem Solving Technique using Computer

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Problem Solving Technique using Computer

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

PROBLEM SOLVING

TECHNIQUE
Made by:- Chirag Srivastava
PROBLEM SOLVING TECHNIQUE
USING COMPUTER

COMPUTER BASED PROBLEM SOLVING IS A SYSTEMATIC PROCESS OF DESIGNING,


IMPLEMENTING AND USING PROGRAMMING TOOLS DURING THE PROBLEM SOLVING STAGE. THIS
METHOD ENABLES THE COMPUTER SYSTEM TO BE MORE INTUITIVE WITH HUMAN LOGIC THAN
MACHINE LOGIC. FINAL OUTCOME OF THIS PROCESS IS SOFTWARE TOOLS WHICH IS DEDICATED
TO SOLVE THE PROBLEM UNDER CONSIDERATION. SOFTWARE IS JUST A COLLECTION OF
COMPUTER PROGRAMS AND PROGRAMS ARE A SET OF INSTRUCTIONS WHICH GUIDES
COMPUTER’S HARDWARE. THESE INSTRUCTIONS NEED TO BE WELL SPECIFIED FOR SOLVING
THE PROBLEM. AFTER ITS CREATION, THE SOFTWARE SHOULD BE ERROR FREE AND WELL
DOCUMENTED. SOFTWARE DEVELOPMENT IS THE PROCESS OF CREATING SUCH SOFTWARE,
WHICH SATISFIES END USER’S REQUIREMENTS AND NEEDS.
THE FOLLOWING SIX STEPS MUST BE FOLLOWED TO
Problem
Analysis

SOLVE A PROBLEM USING COMPUTER.


Program
design

1. Problem Analysis Coding

2. Program Design - Algorithm, Flowchart and Pseudocode


3. Coding
4. Compilation and Execution Proble
m Compilation
& Execution
5. Debugging and Testing Solvin
6. Program Documentation g

Debugging
& Testing

Program
PROBLEM ANALYSIS
Specifying
Problem analysis is the process of defining a problem
the and decomposing overall system into
Objective
smaller parts to identify possible inputs, processes and outputs associated with the problem.
This task is further subdivided into six subtasks namely:
Specifyi First, we need to know what problem
ng the is actually being solved. Making a
Output clear statement of the problem
Before identifying inputs required for depends upon the size and complexity
Specifying
the system, we need to identify what Input of the problem.
comes out of the system. Requireme
nts After having specified the outputs,
the input and data required for the
Specifying system need to be specified as
When output and inputs are Processing
Requireme well.
specified, we need to specify nts
process that converts specified
inputs into desired output Problem
Before concluding the program
Analysis
Documentat analysis stage, it is best to record
ion whatever has been done so far in the
After the successful completion of all the above first phase of program development.
four steps one needs to see whether the things Evaluatin
accomplished so far in the process of problem g the
Possibilit
solving are practical and feasible. y
PROGRAM DESIGN
The second stage in software development or problem solving using computer cycle is
program design. This stage consists of preparing algorithms, flowcharts and pseudocodes.
Generally, this stage intends to make the program more user friendly, feasible and optimized.
Programmer just requires a pen and pencil in this step in which the tasks are first converted
into a structured layout without the involvement of computer. This process of dividing a
program into modules and then into sub-modules is known as “top down” design approach.
Dividing a program into modules (functions) breaks down a given programming task into
small, independent and manageable tasks.
Progr
am
Desi
gn

Algorith Pseudocod
ms Flowchar es
ts
ALGORITHM INTRODUCTION
An algorithm is an effective step-by-step
procedure for solving a problem in a finite
number of steps. In other words, it is a
finite set of well-defined instructions or
step-by-step description of the procedure
written in human readable language for
solving a given problem. An algorithm
itself is division of a problem into small
steps which are ordered in sequence and
easily understandable. Algorithms are very
important to the way computers process
information, because a computer program
is basically an algorithm that tells
computer what specific tasks to perform in
what specific order to accomplish a specific
task. The same problem can be solved with
different methods. So, for solving the same
problem, different algorithms can be
designed. In these algorithms, number of
CHARACTERISTICS OF AN ALGORITHM

An algorithm must possess following characteristics :

Finiteness Input Definitene Effectiven


1.An • An Output ss ess
algorithm algorithm • Each step • Each step
• It should
should may have must be must be
have finite many result at
least one clear, well- simple and
number of inputs or defined should take
steps and it no inputs output
and a finite
should end at all. precise. amount of
after a There time.
finite time. should be
no any
ambiguity.
GUIDELINES FOR DEVELOPING AN ALGORITHM
 Following guidelines must be followed while developing an algorithm:

1. An algorithm will be enclosed by START (or BEGIN) and STOP (or END).
2. To accept data from user, generally used statements are INPUT, READ, GET or OBTAIN.
3. To display result or any message, generally used statements are PRINT, DISPLAY, or
WRITE.
4. Generally, COMPUTE or CALCULATE is used while describing mathematical expressions
and based on situation relevant operators can be used.
Example of an algorithms
Algorithm : Calculation of Simple Interest

Step 1: Start
Step 2: Read principle (P), time (T) and rate (R)
Step 3: Calculate I = P*T*R/100
Step 4: Print I as Interest
Step 5: Stop
ADVANTAGES AND DISADVANTAGES OF ALGORITHM

An algorithm has following An algorithm has following


advantages: disadvantages:

1. Effective Communication: Since algorithm is written in


English like language, it is simple to understand step-by- 1. Developing algorithm for complex
step solution of the problems. problems would be time consuming and
2. Easy Debugging: Well-designed algorithm makes difficult to understand.
debugging easy so that we can identify logical error in the
program. 2. Understanding complex logic through
3. Easy ann Efficient Coding: An algorithm acts as a algorithms can be very difficult.
blueprint of a program and helps during program
development.
4. Independent of Programming Language: An algorithm
is independent of programming languages and can be
easily coded using any high level language.
FLOWCHART INTRODUCTION

 Flowchart is basically a pictorial or


diagrammatic representation of an
algorithm using standard symbols.

 In other words, flowchart is a graphical


representation that explains the sequence
of operations to be performed in order to
solve a problem under consideration.
STANDARD FLOWCHART SYMBOLS

To express different operations in the


flowchart various standard symbols are
used. All symbols are connected among
themselves in order to show the flow of
information and processing. Different
symbols as prescribed by American
National Standard Institute
(ANSI) which are frequently required
while drawing flowchart are tabulated.
GUIDELINES FOR PREPARING FLOWCHART
 Following guidelines must be followed while preparing the flowcharts:

1. Standard symbols should be used while drawing flowchart.


2. Ensure that flowchart has START (or BEGIN) and STOP (or END).
3. Flowchart should be neat, clean and easy to follow. There should be no any ambiguity.
4. The usual direction of flowchart is from top to bottom or from left to right.
5. The terminal symbol, that is, START/BEGIN or STOP/END should have only one flow line.
6. Only one flow line should come out from process symbol.
7. Only one flow line should enter a decision symbol, but two or three flow-lines, one for each possible
answer, can leave the decision symbol.
8. If the flowchart is lengthy and complex connector symbol should be used to reduce the number of
flow lines.
9. Avoid intersection of flow lines.
10. Use annotation symbol to describe steps more clearly.
EXAMPLE OF FLOWCHART

 Flowchart example for calculating simple interest is shown below:


ADVANTAGE AND DISADVANTAGES OF FLOWCHART

Flowchart has Flowchart has


following advantages: following disadvantages:
1. Effective Communication : Flowcharts are better
way of communicating the logic of the system.
2. Effective Analysis : Using flowchart problem can 1. Complex Logic: For complicated logic,
be analyzed more efficiently. flowchart becomes complex and clumsy.
3. Easy Debugging and Efficient Testing : The 2. Difficulty in Modifications: If change is
Flowchart helps in debugging and testing process.
required in the logic then flowchart needs to
4. Efficient Coding : The flowcharts are very useful be redrawn and requires a lot of time.
during program development phase.
5. Proper Documentation : Flowcharts serves as a 3. Difficulty in presenting complex program .
good program documentation, which is needed for
4. It’s a time-consuming process.
various purpose.
6. Efficient Program Maintenance : Maintenance 5. No scope for alteration or modification.
of operating programs becomes easy with the help
of flowchart
PSEUDOCODES

Pseudocode is structured English for


describing algorithms concisely. It is
made up of two words, namely,
pseudo meaning imitation and code
meaning instructions. As the name
suggests, pseudocode does not obey
the syntax rules of any particular
programming language i.e. it is not a
real programming code. It allows the
designer to focus on main logic
without being distracted by
programming languages syntax.
GUIDELINES FOR PREPARING PSEUDOCODE

Following points should be remembered while preparing pseudocode :

1. Pseudocode will be enclosed by START (or BEGIN) and STOP (or END).
2. Pseudocode should be concise so ignore unnecessary details.
3. To accept data from user, generally used statements are INPUT, READ, GET or OBTAIN.
4. To display result or any message, generally used statements are PRINT, DISPLAY, or WRITE.
5. Generally used keywords are capitalized while preparing pseudocode.
Pseudocode : Calculation of
Simple Interest

Step 1: START
Example for Pseudocode
Step 2: READ P, T, R
Step 3: I = P*T*R/100
Step 4: PRINT I
Step 5: STOP
ADVANTAGES AND DISADVANTAGES OF PSEUDOCODE

Advantages of Pseudocode. Disadvantages of Pseudocode.


1. It allows the designer to focus on main logic 1. There are no accepted standards for writing
without being distracted by programming pseudocodes and designer use their own style
languages syntax. while writing pseudocodes.
2. Since it is language independent, it can be 2. Pseudocode cannot be compiled and executed so
translated to any computer language code. its correctness cannot be verified by using
computers.
3. It allows designer to express logic in plain natural
language. 3. Create an additional level of documentation to
maintain.
4. It is easier to write actual code using pseudocode.
4. Introduce error possibilities in translating to code.
5. Unlike algorithms, pseudocodes are concise so
pseudocodes are more readable and easier to 5. May require tool to extract pseudocode and
modify. facilitate drawing flowcharts.
CODING (PROGRAMMING)

In this stage, process of writing actual


program takes place. A coded
program is most popularly referred to
as a source code. The coding process
can be done in any language (high
level and low level). The actual use of
computer takes place in this stage in
which the programmer writes a
sequence of instructions ready for
execution. Coding is also known as
programming.
Good program possess following
characteristics :
1.Comment clauses in the program help to make the program readable and
understandable by
people other than the original programmer.

2.It should be efficient.

3.It must be reliable enough to work under all reasonable conditions to


provide a correct output.

4.It must be able to detect unreasonable error conditions and report them to
the end
user or programmer without crashing the system.

5.It should be easy to maintain and support after installation.


COMPILATION PROCESS
A source code must go through several
steps before it becomes an executable
program. In the first step the source
code is checked for any syntax errors.
After the syntax errors are traced out a
source file is passed through a compiler
which first translates high level
language into object code (A machine
code not ready to be executed). A linker
then links the object code with pre-
compiled library functions, thus creating
an executable program. This executable
program is then loaded into the memory
for execution. General compilation
process is shown in figure:-
DEBUGGING AND TESTING (ERROR AND TYPES
INCLUDED)

To understand debugging and


testing more intuitively, lets first
consider learning about different
types of error that occurs while
programming.
ERROR

Error means failure of


compilation and execution of the
computer program or not getting
expected results after execution.
Debugging and testing are
systematic process during
program development cycle to
avoid errors in the program.
Different types of error that we
encounter while programming
are listed below :
TYPES OF ERROR:
1. Syntax Error : Syntax error is a violation of programming rules while writing it. A syntax error does
not allow the code to run. Syntax error can be easily detected during the compilation process using
compiler.
2. Logical Error : Logical error occurs when a programmer has applied incorrect logic for solving
problem or left out a programming procedure. When logical error occurs program executes but fails
to produce a correct result.
3. Run Time Error : Run time error occurs during the execution of program. Stack overflow, divide by
zero, floating point error etc. are examples of runtime error.
4. Linker errors : Unlike compiler errors, have nothing to do with incorrect syntax.
Instead, linker errors are usually problems with finding the definitions for functions, structs, classes,
or global variables that were declared, but never actually defined, in a source code file.
5. Semantic errors : The third type of error is the semantic error. If there is a semantic error in your
program, it will run successfully in the sense that the computer will not generate any error messages.
However, your program will not do the right thing. It will do something else. Specifically, it will do
what you told it to do.
DEBUGGING

Debugging is the process of finding


errors and removing them from a
computer program, otherwise they will
lead to failure of the program. Even
after taking full care during program
design and coding, some errors may
remain in the program and these errors
appear during compilation or linking or
execution. Debugging is generally done
by program developer.
TESTING

Testing is performed to verify that whether


the completed software package functions
or works according to the expectations
defined by the requirements. Testing is
generally performed by testing team which
repetitively executes program with intent
to find error. After testing, list of errors and
related information is sent to program
developer or development team.
DEBUGGING VS TESTING

MAJOR DIFFERENCES BETWEEN DEBUGGING AND TESTING ARE POINTED BELOW :

Debugging Testing

 It is the process of fixing errors.  It is the process of finding as many errors


 Debugging is done during program as possible.
development phase.  Testing is done during testing phase which
 Debugging is done by program developer. comes after development phase.
 Testing is generally carried out by
separate testing team rather than
program developer.
PROGRAM (PROGRAMMER'S AND USER'S)
DOCUMENTATION

The program documentation is the process of collecting information about the program. The
documentation process starts from the problem analysis phase to debugging and testing.
Documentation consists two types of documentation, they are:

1. Programmer's Documentation
2. User's Documentation
Programmer's Documentation
Programmer’s documentation contains all the technical details.
Without proper documentation it is very difficult even for the original programmer
to update and maintain the program.
A programmer’s documentation contains the necessary information that a
programmer requires to update and maintain the program.
These information includes:
1.Program analysis document, with a concise statement of program’s objectives, outputs and processing
procedures.
2.Program design documents with appropriate flowcharts and diagrams.
3.Program verification documents for outlining, checking, testing and correction procedures along with the list of
sample data and results.
4.Log used to document future program revision and maintenance activity.

User's Documentation
User documentation is required for the end user who installs and uses the program.
It consists instructions for installation of the program and user manual.
Made By:-

Coming Soon

You might also like