Unit Computer Programming Warm-up Task What do you know about programming? Answer the Internet Quiz


Algorithm Development and Pseudocode



Download 272.18 Kb.
Page4/5
Date03.05.2017
Size272.18 Kb.
#17077
1   2   3   4   5

Algorithm Development and Pseudocode

An algorithm is a solution to a problem. Computer scientists are in the problem-solving business. They use techniques of structured programming to develop solutions to problems. Algorithms will range from the easier "finding the average of two numbers" to the more difficult "visiting all the subdirectories on a hard disk, searching for a file."

A major task of the implementation stage is the conversion of rough designs into refined algorithms which can then be coded in the implementation language of choice.

Pseudocode refers to a rough-draft outline of an answer, written in English-like terms. We will probably use phrases and words which are close to programming languages, but avoid using any specific language. Once the pseudocode has been developed, translation into code occurs more easily than if we had skipped this pseudocode stage.



Stepwise refinement is the process of gradually developing a more detailed description of an algorithm. Problem solving in computer science involves overall development of the sections of a program, expanding each section with more detail, later working out the individual steps of an algorithm using pseudocode, then finally writing a code solution.
Word-play
Task 9. Complete the crossword puzzle and find the key word in 15 down.
Across

  1. a statement that explains what something looks like, or how it behaves

  2. the process of writing and testing programs for computers

  3. a pejorative term for code with a complex and tangled control structure, especially one using many GOTOs, exceptions, or other "unstructured" branching constructs

  4. the rate of translating a high-level language into machine code

  5. a group of items that are in a certain order

  6. a human-readable notation for the machine language that a specific computer architecture uses

  7. the control structure allowing choice among different directions

  8. the information that explains how to use software or hardware

  9. a product review performed by a formal team. A number of such reviews may be held during the lifetime of a software project, covering, for example, requirements specification, program specifications, design, and implementation.

  10. …… editor - a program that combines one or more files containing object code from separately compiled program modules into a single file containing loadable or executable code

  11. part of a computer program, which tells the computer what to do at that stage

  12. a set of rules that must be followed when solving a particular problem

  13. a way of writing a description of a computer program using a mixture of natural language and computer language code

  14. the period of time during which a program is executed


Down

  1. the act of starting to use a plan or computer system, etc.







1













15



















2





































3




























4





































5

























6




























7




























8











































9































10

























11


































12




























13


































14




















Speaking
Task 10. Work in pairs, Student A and Student B. Look at the cartoons A and B. They are related in some way. You each have one minute to describe what your cartoon shows.
Student A should turn to the cartoon A on page 89.

Student B should turn to the cartoon B on page 92.
When you have finished, discuss


  1. What is similar about the situations and the problem in the three cartoons?

  2. What are the differences?

  3. What message is each cartoon trying to convey?


Unit 6. Object Oriented Programming

Warm-up
Task 1. Answer the following questions:


  1. What is object oriented programming?

  2. What are the basic features of object oriented programming?

  3. What are object oriented languages? Give any examples.

  4. What are they used for?


Reading
Task 2. Now read the text and decide on a suitable title for it.
One of the principal motivations for using OOP is to handle multimedia applications in which such diverse data types as sound and video can be packaged together into executable modules. Another is writing program code that’s more intuitive and reusable; in other words, code that shortens program-development time.

The object oriented programming paradigm entails the development of active program units called objects, each of which contains procedures describing how that object should respond to various stimuli. These internal procedures are called methods (or member functions in the C++ vernacular). The object oriented approach to a problem is to identify the objects involved and describe them and their associated methods as self-contained units. In turn, object oriented programming languages provide statements for expressing these ideas.

To simplify the description of objects with similar yet different characteristics, most object oriented languages allow one class to encompass the properties of another through a system as inheritance.

The existence of a variety of objects with similar yet different characteristics leads to a phenomenon reminiscent of overloading, which is the use of a single symbol, such as +, for representing different operations depending on the type of its operands. Suppose that an object oriented graphics package consists of a variety of objects, each representing a shape (circle, rectangle, triangle, etc.). A particular image consists of a collection of these objects. Each object knows its size, location, and colour as well as how to respond to messages telling it, for example, to move to a new location or to draw itself on the monitor screen. To draw an image, we merely send a ‘draw yourself’ message to each object in the image. However, the routine used to draw an object varies according to the shape of the object – drawing a squire is not the same process as drawing a circle. This customized interpretation of a message is known as polymorphism; the message is said to be polymorphic.

Another characteristic associated with object oriented programming is encapsulation, which refers to restricting access to an object’s internal properties. To say that certain features of an object are encapsulated means that only the object itself is able to access them. Features that are encapsulated are said to be private. Features that are accessible from outside the object are said to be public.


Download 272.18 Kb.

Share with your friends:
1   2   3   4   5




The database is protected by copyright ©ininet.org 2024
send message

    Main page