Problem Solving

Q.1 what’s the matter resolution
Ans: Problem resolution could be a talent which might be developed by following a Well organized approach. Programming may be best delineate as drawback resolution method. Programming is that the method by that a group of directions is created in any computer-oriented language to urge needed results. If you’re sensible thinker, you have got the potential to become an honest software engineer. guaranteeing that the right drawback is being solved needs careful study of why a retardant exists. that’s Why first of all the matter should be clearly identified. Once the matter is identified and a logical answer of the matter has been obtained, there ar different steps should be disbursed before associate actual worm really exists.

Steps of drawback resolution method

The following steps may be followed to resolve any reasonably drawback.

Problem identification.
Specify necessities.
Analyze the matter.
Document the program.
i- drawback identification

At this stage the matter being solved is ascertained rigorously. Major aras of concern are identified and tangential info is filtered out. By filtering out tangential info we are able to consider the particular drawback. outline and perceive the matter space.

ii- Specify necessities

Most of the users cannot make a case for their precise code necessities.

They are unsure regarding what they need to try and do with the code. so that they seem with a obscure set of necessities in mind which can cause a wrong answer.

This stage demands to create clear the user necessities in order that a correct answer may well be recommended. This stage involves the formation of a necessities document that describes the options the system is predicted to supply, the restrictions below, that it should operate, associated an abstract description of the code which give la basis for style and implementation.

iii- Analyzing the matter

At this stage the issues rotten into sub-problems. Rather on concentrating the larger drawback as an entire, we tend to try and solve every sub-problem on an individual basis. This ends up in an easy answer. this system is thought as prime down style. Here we tend to could raise bound question to approach the proper answer i.e.

How many solutions ar there to the given problem?
Which one is that the best solution?
Can the matter be solved on pc
What programing language to use
What ar input and output?
How will the larger drawback be divided into sub problems‘?
iv- style algorithmic rule and draw flowcharts

Designing the algorithmic rule needs to develop a finite list of steps to resolve a retardant. it’s then verified that whether or not the algorithmic rule solves the matter as meant or not. Writing algorithmic rule is usually the foremost troublesome a part of the matter resolution method. Once the algorithmic rule has been designed, it ought to be verified through table checking. Most pc algorithms perform a minimum of following 3 steps:

Get information (Input)
Perform computation (Processing)
Display results (Output)
After coming up with the algorithmic rule, consequent step is to draw a flowchart. multidimensional language shows the pictorial demonstration of the flow of program. in truth the flowchart could be a pictorial ‘representation of associate algorithmic rule.

v- Write the program (Coding)

A program code is written when drawing flowchart. This step involves the conversion of associate algorithmic rule to a program, written in any ‘programming language. it’s simple to convert that sets of instruction into any programing language. For this purpose the software engineer should grasp the syntax of the programing language chosen. The grammatical rules of a programing language to jot down programs ar spoken as syntax of that programing language.

vi- take a look at and rectify the program

After writing a program code, the foremost very important step is testing “of the program. This stage needs evaluating the program to verify that it works as desired. which is able to clear its performance and desired result? Run the program many times exploitation totally different sets of information, ensuring that it works properly for each state of affairs provided within the algorithmic rule. If it’s not manufacturing desired results, then errors should be pointed‘ out and debugged. Debugging is that the method of locating and eliminating the errors.

vii- Implement the program

Implementation is that the method of taking the program and inserting it into operation. one among the simplest ways that to implement a replacement program is termed running the program in parallel. below this condition, the new program is run with existing system. LF there ar issues with the new programs, they will be corrected whereas the present system remains getting used. when the bugs ar out, the new programs ar slowly phased in, whereas the recent system is slowly phased out. If there ar many new programs to be enforced, this introduce and terminate methodology is employed for every program,” one at a time. coaching is another vital side of implementation.

viii- Maintain and update the program

Program maintenance is associate in progress method of up grading the program to accommodate new hardware. or code necessities, and introducing minor enhancements. basically, it’s the enlargement, change and improvement of a program when its installation. Regular maintenance is important to the continued utility of a program. a correct maintenance depends on the existence of complete documentation.

ix- Document the program .

Documentation is that the method of recording details of programs regarding the system. it’ll be convenient for person, World Health Organization desires to create sweetening, implementation or removing any errors within the program in future. In general, comprehensive documentation consists of the subsequent.

A description of what the program is meant to try and do.
A description of the matter answer.
A description of the program style, together with any aids used.
A description of the program’s testing method, together with the take a look at information used and results obtained.
A description of all corrections, modifications, and updates created to the program since it absolutely was place into operation.
A user manual.
Q.2:- Why it’s advisable to arrange the logic of a program before writing it?

Ans.:- Logic of a program
It is advisable to arrange the logic of a program before writing it thus if there’s any ambiguities or flaw within the program it ought to be corrected at the time of designing the logic. Logic is that the path, which is able to guide the software engineer to develop a program. it’ll additionally cut back the time constraint within the future. Any error can crash the program and information hold on.

Ensuring that the right drawback is being solved needs careful study of why a retardant exists. 1st of all the matter should be clearly identified. Once the matter has been identified, the second step is to develop properly the logic to resolve the matter.

Q.3.What is debugging? what number varieties of errors, will occur during a program? Describe briefly.

Ans. Debugging
The process of finding and removing errors from a worm is termed debugging. This important a part of program development usually takes as long because the actual style and writing steps.

Types of Errors

There may be 3 varieties of programming errors, that ar as following:

1 . Syntax Errors two. Runtime Errors s three. Logical Errors

1. Syntax Errors

A software error happens once the program violates one or a lot of grammatical rules of the prograrmning language. This involves incorrect punctuation, incorrect word sequence, undefined terms or misuse of the terms. These errors ar mechanically detected by the language processors at compile time. as an example if an announcement PINT rather than PRINT is employed it provides software error. the pc can indicate the software error on execution.

2. Runtime Errors

A semantic error happens once the program directs the pc to perform nonlegal operation like dividing variety by zero. In such cases either the execution of the program is delayed or generally it provides absurd results. The execution errors like logical errors are difficult to find. Runtime errors ar detected and displayed by the pc throughout the execution of a program.

3. Logical Errors

Logic errors occur once a program follows a wrong logic. The language translator doesn’t report any error message for a logical error. These errors, could also be thanks to improper use of the formula or wrong use of the symbols or information as an example if we tend to write the formula for speed as: V=S x T

Instead of V=S / T. it’s a logical error.

The computer is unable to discover such errors and so provide out wrong result. Logical errors ar difficult to find even after they ar noted to exist. To discover logical errors, we tend to run the program with noted information referred to as take a look at information. The results obtained with take a look at information is checked and verified. once the logical error is decided, it’s removed by creating necessary changes within the program. this is often referred to as logical debugging.

Q.4. Define associate algorithmic rule. additionally write down the strategy for developing algorithmic rule.

Ans. Algorithm
An algorithmic rule could be a finite set of steps that, if followed, accomplish a selected task. It provides the sequence during which these steps ar taken for resolution the matter. the only variety of algorithmic rule is step-form algorithmic rule. It consists. of a sequence of numbered steps. associate algorithmic rule should be clear, finite and effective.

Characteristics of associate algorithmic rule

In order to qualify as associate algorithmic rule, a sequence of directions should possess the subsequent characteristics:

1 . every and each instruction ought to be precise and clear.

2. every instruction ought to be performed during a finite time.

3. directions shouldn’t be recurrent infinitely.

4. Desired result ought to be obtained when the algorithmic rule terminates.

Strategy for Developing algorithmic rule

Algorithm development involves the subsequent steps to hold out. we are able to proceed‘ to correct solution‘ of a -particular drawback by adopting the subsequent strategy.

Step 1: Investigation

Identify the processes.
Identify the key selections.
Identify the repetitions.
Identify the variables.
Step 2: Investigation

Devise a high level algorithmic rule.
Step through the algorithmic rule. will this “walk through” reveal any major problems? If it will then correct the issues.
Step 3: Investigation

Incorporate any refinements indicated in step two.
Group along processes wherever applicable.
Group along variables wherever applicable.
Test the algorithmic rule once more by stepping through it.
Let us contemplate the subsequent example to know the means of approaching an answer to a retardant.

Problem:- you have got to bake a cake in your house

Step-form algorithmic rule

The algorithmic rule for baking a cake is as follows:

Step 1: Heat kitchen appliance up to 325 F.

Step 2: Gather the ingredients. .

Step 3: combine ingredients completely during a bowl.

Step 4: Pour the mixture into a baking pan.

Step 5: Bake within the kitchen appliance fifty minutes.

Step 6: Repeat

Bake five minutes a lot of

Until cake prime springs back once touched within the center two

Step 7: Cool on a rack before cutting.

Q.5 Write a step type algorithmic rule for creating a tea.

Ans. Step-form algorithmic rule for creating of tea
An initial try at associate algorithmic rule may be:

Put tea leaves in pot. :> i Add water to pot.\
Boil water.
Wait five minutes.
Pour tea into cup.
First Refinement:

These steps ar most likely not elaborate enough to create tea. we tend to so refine each-step into a sequence of additional easier steps:

Step 1: place tea leaves in pot

It might be refined to

Open box of tea
Extract one containerful of tea leaves.
Put containerful into pot.
Close box of tea.
Step 2: Boil water

It might be refined to

Fill kettle with water.
Switch on kettle.
Wait till water is cooked
Switch off kettle.
Step 5: Pour tea into cup

It might be refined to

Pour tea from pot into cup till cup is full
Second Refinement:

Some of the refined steps could also be additional refined. as an example step two may be refined as:

Step 1: Fill kettle with water

It might be refined to
Pour kettle below faucet.
activate faucet.
Wait till kettle is full.
Turn off faucet.
Others steps can also need additional refinements.

Q.6 Write down associate algorithmic rule to search out the add of first fifty natural numbers

Ans. Algorithm



DO whereas (N

Please follow and like us: