Chapter 6: Data and Algorithms


6.1 Introduction

Computer problem solving is the process of designing a solution to a problem, and converting that solution into a program. An algorithm is a detailed and precise sequence of activities that accomplishes a solution to a problem. The solution includes the data description for the data to be manipulated and the data produced. A program is a computer implementation of data description and the corresponding algorithm. Problem solving involves finding a solution to a problem and describing that solution as an algorithm.

Computer programming is the translation of an algorithm into a program using appropriate programming language statements. The program consists of a group of data descriptions and instructions to the computer for producing correct results when given appropriate data. The program tells the computer how to transform the given data into correct results. The algorithm has to be broken down by decomposition into classes and functions.

An algorithm must be designed for each function in a class. This chapter explains the general structure of an algorithm using flowcharts and pseudocode. A general introduction to the four design structures for describing algorithms is presented. These structures are sequence, selection, repetition, and input/output. Two of these, sequence and input/output, are explained in some detail and are applied in the case studies.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net