Problem solving using computer chapter- 2

Problem analysis:

To make  program errorless and clear and concise the problem analysis should clearly specify the fallowing things:

  1. Objectives
  2. Output requirements
  3. Input requirements
  4. Processing requirements
  5. Evaluating feasibility

Algorithm development:

It is a set of ordered step to produce a necessary solution of problem is called algorithm. It is also defines as the ordered sequence of well instructions to perform a specific task in finite time. The advantages of algorithm are given below:

  1. Finiteness: each algorithm have a finite number of steps to solve a problem.
  2. Effectiveness: it should be more effective way to solving a problem.
  3. Input: inputs of algorithm gives precisely , which can be give initially or when program runs.
  4. Output: each algorithm gives one or more result.
  5. Definiteness: the action of each statement gives clearly.

Flowchart:

It is a graphical representation to produce a solution of problem.  To make a flowchart fallowing symbol is using which are given below:

Fig: symbol use in flowchart

Advantage:

  • Communication: As diagrams are better way to provide information, flowchart will communicate the logic of the whole system concisely and efficiently.
  • Effective Analysis: Problem can be analyzed more effectively resulting in reduction in cost and time
  • Proper Documentation: As flowchart contains information about the working of the system, it helps to make documentation better.
  • Efficient Coding: the flowchart acts as a guide for the programmer to write a code in more efficient manner, since the steps and requirements are clearly defined in diagram.
  • Proper Debugging: The flowchart, sometimes, can be helpful in debugging process.
  • Efficient Program Maintenance: The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put efforts more efficiently on that section.

Disadvantages:

  • Complex and clumsy: when the program gets quite complicated, the flowchart can be more complex than it is imagined to be.
  • Difficulty in modifications: When some alterations are to be done, the flowchart may require re-drawing.

Guidelines for draw a flowchart:

  1. First, make the list of all necessary requirements in logical order.
  2. Direction of flowchart should be always top to bottom or left to right.
  3. The entry and exit of flowchart is always only one and to determined  entry , exit , input , output ,decision ,processing use proper symbol.
  4. If the flowchart be complex it is better to use connector to reduce a number of flowlines.
  5. It is use to simple test data to check the validity of flowchart.

Error and its type:

The program which produce the undesirable result is called error. Error are two types which are given below:

  1. Compile time error: error produce due to the violating of rule is called compile time error. It is also called syntax error. It is detected by compiler. Eg: if program statement is not end with semicolon then its type of error is shows.
  2. Run time error: it is the error which shows due to mismatch of data of logic. It is also two type which are given below:
  3. logical error: the error which is produce due to wrong logic.
  4. Latent error: it is hidden error which is shows up only  particular  set up data is used.eg: x= (m+n)/(a-b) . if a = b then this type of error is shows.

Debugging and Testing:

It is a process of finding a error or bugs in program. It is a process of isolating and fixing the error which is found in the testing phase is  called debugging. The different process of fixing a error are given below:

  • Error Isolation: In this method, a particular section is isolated by making them comments. If error doesn’t occur after isolating certain part of code, then we may predict that the part of code has some error.
  • Tracing: Using this method, we display the value of the variables at different places to see how they change. And undesired value of such variables will help to locate the error.
  • Watch values: A watch value represents a value of a variable or expression, whose updated values are continuously shown to the programmer during the execution of the program. Inspecting the unexpected changes in the variable can help to determine what the fault is.
  • Breakpoints: These are the temporary stopping point of the program execution. The program stops its execution at the breakpoints. It can be used with watch values to inspect the value of different variables to the particular point.
  • Stepping: It is the process of executing one statement at a time. It will be easier to determine which instruction is causing problem by stepping through the entire program.

Different phases or steps of developing software:

 The following phases are included in a software development.

  • Problem Analysis: This is the first step of software development in which we define our objectives, analyze our input, processing and output requirements. Depending on the size and complexity of the problem, a clear statement of the problem is made. And the types and number of inputs and outputs are evaluated. Finally, a mechanism to convert available resources into final productive results must be determined.
  • Algorithm Development and Flow Diagram: In this phase, a general outline of the problem is sketched using algorithm and flow chart. Algorithms are used to define a set of steps or procedures to be followed to solve a given problem while flowcharts are the diagrammatic representation of the steps to solve a particular problem.
  • Coding: It is the process of writing a program using a particular programming language. Though high level languages are more preferred, low level language can be used as well to write a program. Depending upon the ease and accessibility, the programmer may use any platform to write a program.
  • Compilation and Execution: When the programs are written into high level language, then it needs to be converted into low level language. This conversion is done by compiler and the process is called compilation. After the compilation process, an executable program will generate which when opened is set to execution. Different inputs are provided to check if the defined objectives are fulfilled or not.
  • Debugging and Testing: Testing is the process of finding errors in the program while debugging is the mechanism to remove the different errors that are present in the program. General syntax error will be pointed by the compiler, but the run time errors must be checked by providing different sets of inputs to the program and tracing the output.
  • Program Documentation: It is done for future reference which can be analyzed for better software development in later days. Documentation includes all the information about the program.

Characteristics of a well written program:

 A feature of software defines the distinguishing characteristics of software based on performance, portability or functionality. Some of the important characteristics of well written computer programs can be:

  • Integrity refers to the accuracy of the calculations.
  • Clarity refers to the overall readability of the program.
  • Modularity means dividing the program into small modules which are independent of each other. It enhances the accuracy and clarity and facilitates future program alterations.
  •  Interoperability is the ability of the software to exchange information with other applications and make use of information transparently.
  • Portability is the ability of the software to function in different platforms and environments

Leave a Reply

Your email address will not be published. Required fields are marked *