Учебное пособие состоит из двух частей и англо-русского словаря. Материалом для пособия послужило американское издание для изучающих компьютер P. Norton "Introduction to Computers"


Structured and Object-Oriented Programming



бет10/61
Дата27.10.2022
өлшемі0,7 Mb.
#45740
түріУчебное пособие
1   ...   6   7   8   9   10   11   12   13   ...   61
Structured and Object-Oriented Programming

      1. Read and translate the text:

Structured Programming Structured programming evolved in the 1960s and 1970s. The name refers to the practice of building programs using a set of well-defined structures:
Sequence structure defines the default control flow in a program. This structure is built into programming languages. A computer executes lines of code in the order in which they are written. It is possible, as a result of a conditional statement or a function call, that the flow may have the option of going in one of several different directions.
Selection structures are built around the conditional statements. If the conditional statement is true, certain lines of code are executed. If the conditional statement is false, those lines of code are not executed.
Repetition structures (or looping structures) use the loops. In a repetition structure, the program checks a conditional statement and executes a loop based on the condition. If the condition is true, then a block of one or more commands is repeated until the condition is false.


Object-Oriented Programming
In the 1980s object-oriented programming (OOP) was developed. Many programmers claim that an object orientation is a natural way of thinking about the world and it makes programs simpler and programming faster.
Concepts of object-oriented programming are objects and classes. OOP enhances structured programming. Objects are composed of structured program pieces, and the logic of manipulating objects is also structured. Every object has attributes and functions and may contain other objects. For example, the car object has attributes (color, size, shape, top speed), functions (moves forward, moves backward, opens its windows) and may encapsulate other objects (tires, chassis, drive-train) with their own attributes and functions. All objects belong to classes. A class consists of attributes and functions shared by more than one object. All cars, for example, have a steering wheel and four tires. All cars can drive forward, reverse, park, and accelerate. Class attributes are called data members, and class functions are represented as member functions or methods.
Classes can be divided into subclasses. The car class, for example, could have a luxury sedan class, a sports car class, and an economy car class. Subclasses typically have all the attributes and methods of the parent class. Every sports car, for example, has a steering wheel and can drive forward. This phenomenon is called class inheritance. In addition to inherited characteristics, subclasses have unique characteristics of their own (fuel economy, trunk space, appearance).
When an object is created, it automatically has all the attributes and methods associated with that class. In the language of OOP, objects are instantiated (created).
Objects do not typically perform behaviors spontaneously. A car, for example, cannot move forward and backward at the same time or drive forward spontaneously. You send a signal to the car to move forward by pressing on the accelerator. Likewise, in OOP, messages are sent to objects, requesting them to perform a specific function. Part of designing a program is to identify the flow of sending and receiving messages among the objects.

Vocabulary:

1. to structure ['strAktSq] – структурировать


structured programming ['strAktSqd 'prqugrxmiN]– структурное программирование

  1. object ['obGikt] – объект

object-oriented programming ['obGikt 'Lrientid 'prqugrxmiN] (OOP) – объектно-ориентированное программирование

  1. to evolve [i'volv] – возникать, появляться

  2. to refer [ri'fW] – иметь отношение, относиться (к ч.-л.)

  3. default [di'fLlt] – используемый по умолчанию

  4. control flow [kqn'trqul flqu] – управляющая логика (программы)

  5. line [lain] – строка

  6. possible ['posqbl] – возможный

  7. conditional statement [kqn'diSqnl 'steitmqnt] – условное утверждение, услов­ный оператор

  8. function call ['fANkSn kLl] – вызов функции, обращение к функции

  9. option ['opSn]– опция

  10. different ['difrqnt] – различный, разный

  11. selection [sq'lekSn] – выбор, отбор

  12. true [tru:] – истинный

15.false [fLls] – ложный
16.to repeat [ri'pi:t] – повторять
repetition [‚repi'tiSn] – повторение
17.loop [lu:p] – цикл

  1. to become [bi'kAm] (became, become) – становиться

  2. concept ['konsept] – понятие

  3. to enhance [in'hRns] – расширять, совершенствовать

  4. to compose [kqm'pquz] – составлять; to be composed (of) – быть составленным, состоять (из)

  5. attribute ['xtribju:t] – атрибут, свойство, характеристика

  6. top speed [top spi:d]– максимальная скорость

  7. forward ['fLwqd] – вперёд

backward ['bxkwqd] – назад

  1. to encapsulate [in'kxpsju:leit] – заключать в себе, включать в себя

  2. tire ['taiq] – шина, покрышка

  3. chassis ['Sxsi:] – шасси

  4. drive-train ['draivtrein] – двигатель

  5. to belong (to) [bi'loN] – принадлежать (ч.-л.)

  6. steering wheel ['stiqriN wi:l] – рулевое колесо

  7. to drive [draiv] (drove, driven) – ехать

  8. reverse [ri'vq:s] – обратный, в обратном направлении

  9. to accelerate [qk'selqreit] – увеличивать скорость

accelerator [qk'selqreitq] – педаль для газа

  1. member ['membq]– член, элемент набора, элемент множества

  2. luxury ['lAkSqri] – роскошь

  3. parent ['pFqrqnt] – родительский, порождающий

  4. to inherit [in'herit] – наследовать

inheritance [in'heritqns] – наследование

  1. to instantiate [ins'txntieit] – создавать экземпляр

  2. behavior [bi'heivjq] – поведение, линия поведения, характер изменения

  3. spontaneously [spon'teinjqsli] – спонтанно, непроизвольно

  4. to press [pres] – нажимать, надавливать

  5. likewise ['laikwaiz] – подобно, так же, таким же образом

  6. message ['mesiG] – сообщение, передаваемый блок информации

  7. to request [ri'kwest] – запрашивать

  8. to identify [ai'dentifai] – идентифицировать, распознавать

II. Answer the questions:



    1. What is structured programming?

    2. What are the three structures used in structured programming?

    3. How does sequence structure work?

    4. What is the difference between selection structure and repetition structure?

    5. When was object-oriented programming developed?

    6. What are the basic concepts of object-oriented programming?

    7. What is an object made up of?

    8. What is an object characterized by?

    9. Give the example of an object and its attributes and functions.

    10. What does a class consist of?

    11. What are class attributes and functions called?

    12. Give an example of a subclass.

    13. What is meant by class inheritance?

    14. How do objects perform functions in object-oriented programming?

III. Tell whether the following statements are true or false:



    1. There are three basic structures used in structured programming.

    2. Sequence structure defines the default control flow in a program.

    3. Sequence structure and selection structure are similar.

    4. With selection structure, if the condition is true, then a block of one or more commands is repeated until the condition is false.

    5. With the repetition structure, the program checks a conditional statement and executes a loop based on the condition.

    6. Object-oriented programming was developed in the 1970s.

    7. With the OOP programming becomes faster.

    8. The basic concepts of object-oriented programming are objects, classes and structures.

    9. Every object in OOP may encapsulate other objects.

    10. All objects belong to subclasses.

    11. Class inheritance means that subclasses of objects typically have all the attributes and methods of the parent class.

    12. In OOP, messages are sent to objects for them to perform a specific function.


      1. Fill in the blanks:

  1. ___________, ___________ and ____________ are used in structured programming.

  2. Selection structures are built around _______________.

  3. In a repetition structure, the program _____________ a conditional statement and _____________ a loop based on the condition.

  4. The acronym OOP stands for ______________.

  5. With the object- oriented programming programs become ___________ and programming becomes _____________.

  6. A(an) ________________ is a component of an object’s overall description.

  7. Class attributes are called ___________, and class functions are represented as ____________.

  8. Subclasses have _____________ and _____________ characteristics.

  9. In the language of OOP, objects are _____________.

  10. Objects send ________________ to one another, to make requests.

      1. Choose the right answer:




  1. With this structure, if the condition is true, then a block of one or more commands is repeated until the condition is false.

    1. Selection structure c. Sequence structure

    2. Repetition structure d. All the above

  2. In structured programming selection structures rely (полагаются) on the use of

    1. Conditional statements c. Functions

    2. Loops d. Objects

  1. The basic concepts of object-oriented programming are

    1. Classes c. None of the above

    2. Objects d. All the above

  2. In object-oriented programming attributes and functions define a(an)

    1. Object c. Class

    2. Statement d. Subclass

  3. In object-oriented programming the term “encapsulate” means

    1. Contain c. Evolve

    2. Enhance d. None of the above

  4. Objects can share attributes and functions. Taken together, these shared attributes and functions constutute (составляют) a

    1. Class c. Member

    2. Message d. Condition

  5. All objects belong to

    1. Members c. Messages

    2. Classes d. Statements

  6. In the language of object-oriented programming the term “instantiate means

    1. Send c. Create

    2. Inherit d. Include




      1. Match each item to the correct statement below:




    1. Structured programming c. Sequence structure

    2. Object-oriented programming d. Selection structure

  1. Uses attributes and functions.

  2. Controls program flow in three ways.

  3. Built around the conditional statements.

  4. Built into programming languages.

  5. Earlier development.

  6. Makes programming faster.




    1. Class c. Data members

    2. Subclass d. Data functions

  1. Have all the attributes and methods of the parent class.

  2. Objects belong to them.

  3. Class attributes are referred to them.

  4. Class functions are called so.

  5. Have both inherited and unique characteristics.

  6. Consists of attributes and functions shared by more than one object.




      1. Speak on the contents of the text using the following chart:




Text 6


Достарыңызбен бөлісу:
1   ...   6   7   8   9   10   11   12   13   ...   61




©emirsaba.org 2024
әкімшілігінің қараңыз

    Басты бет