Problem Solving Skill
Problem Solving Skill
In order to build a computer system that performs a specific task or solves a given problem, the
task or problem has to be clearly defined, showing what is going to be computed and how it is
going to be computed. This chapter introduces the tools and techniques that are used to design
a software solution that together with the associated computer hardware will form a computer
system.
Computer systems can be very large or very small or any size in between; most people interact
with many different computer systems during their daily life without realizing it.
For example, when I wake up in the morning I use an app on my smart phone for my alarm, I
then check the weather forecast on my computer before I drive to work. The alarm program is a
very small computer system; when I check the weather forecast I obtain information from one of
the largest computer systems in the world.
Using computer to solve problem involves far more than just writing a program. In fact many
computer applications are carried out without writing new programs. Existing software is used if
possible.
Solving a problem may be seen in three main stages:
1. Defining exactly what the problem is.
2. Designing the solution to deal with it.
3. Putting that solution into practice.
In solving an information processing problem we should define:
1. The data which is to be input.
2. The data which is to be output.
3. The data which is to be stored as files.
4. The processing tasks to be carried out.
SYSTEM
Subsystem:
A unit or device that is part of a larger system. For example, a disk subsystem is a part of a
computer system. A bus is a part of the computer. A subsystem usually refers to hardware, but
it may be used to describe software. However, "module," "subroutine" and "component" are
more typically used to describe parts of software.
Library
In computer science, a library is a collection of non-volatile resources used by computer
programs, often to develop software. These may include configuration data, documentation,
help data, message templates, pre-written code and subroutines, classes, values or type
specifications.
Library code is organized in such a way that it can be used by multiple programs that have no
connection to each other.
Most compiled languages have a standard library although programmers can also create their
own custom libraries. Most modern software systems provide libraries that implement the
majority of system services
Routine / Program
A set of programming instructions designed to perform a specific limited task.
Subroutine
Subprograms may be defined within programs, or separately in libraries that can be used by
multiple programs. In different programming languages, a subroutine may be called a
procedure, a function, a routine, a method, or a subprogram. The generic term callable unit
is sometimes used.
Stepwise refinement:
Stepwise refinement is the process of developing a modular design by splitting a problem into
smaller sub-tasks, which themselves are repeatedly split into even smaller sub-tasks until each
is just one element of the final program.
A Top-down design is when a problem is split into smaller sub-problems, which themselves are
split into even smaller sub-problems until each is just one element of the final program.
Top down design provides a method of producing computer programs or systems. These are
the main features of top-down design:
Breaking problems into smaller parts makes it clear what needs to be done. At each stage of
refinement, the problem becomes less complex and easier to work out.
Benefits and drawbacks of modular programs
Benefits Drawbacks
Smaller problems are easier to understand Modules must be linked and additional testing must
be carried out to make sure that the links work
correctly.
Smaller problems are easier to test and debug Programmers must be sure that cross-referencing
is done
Development can be shared between a team of Interface between modules must be planned
programmers- each person programming different
modules according to their tasks and skills.
Code from previously programmed modules can be
reused.
Data structure diagram (DSD) is a diagram of the conceptual data model which documents the
entities and their relationships, as well as the constraints that connect to them.
The basic graphic notation elements of DSDs are boxes which represent entities. The arrow
symbol represents relationships. Data structure diagrams are most useful for documenting
complex data entities.
Structure diagrams
A diagram can be used to show how this is achieved. This is known as structure diagram.
Structure diagrams are particularly useful when the problem has been broken down into these
smaller tasks and then broken down into even smaller subtasks. This Method of solving problem
is known as top-down design or stepwise refinement.
Check what Write list Select food Pay for food Unpack Food Put into store
food already
in store
ALGORITHM:
This involves:
Dry running is the process of thinking through the operation of an algorithm, to test it during
design, for troubleshooting and to work out its purpose, if not stated.
A trace table is a tabular record of a dry run. It has a column for each variable, usually in the
order in which their values are first assigned. Each row is completed with the values of the
variables whenever they change, moving to the next row when necessary.
Algorithm vs Pseudocode :
Algorithm:
There are lots of formats used for writing pseudocodes and most of them borrow some of the
structures from popular programming languages such as C, Lisp, FORTRAN, etc.