Unit3 - Languages With Exercises Modals
Unit3 - Languages With Exercises Modals
As was mentioned in the last unit, the computer uses high and low voltage along the
control lines/bus to tell the different parts of the computer what to do and what to
use. It uses what is called conventional machine language. We use binary (0’s
and 1’s) to express that language and microassembly to write it.
Assembly, and early computer languages such as FORTRAN, COBOL, and BASIC,
were all procedural languages – do this, then do this, then do this, etc. The CPU still
does this.
In procedural languages, data are considered to be discrete. That is, the data item
has no other properties except for what it has been declared as, e.g. integer,
character, Boolean.
As the demand for more complex problems to be solved by the computer arose,
then object-oriented (OO) languages such as Java, Python, C++, Visual Basic,
.NET and Ruby were developed. In such languages, the data, which are called
objects, instances, or entities depending on the language, have other properties
that called attributes. These attributes (or descriptors) that are declared or
inherited.
Languages can also be distributed into two other groups – compiled and
interpreted.
With compiled languages, such as C, C++, COBOL, FORTRAN, and Pascal, the
program MUST be completely WITHOUT syntax error before it can be executed.
That means all variables must be declared in the program before they can be used.
While this is very time-consuming, the computer can run such programs very fast.
These languages are hardest on the programming, easiest on the machine.
With interpreted languages, such as BASIC, MATLAB, and PHP, a program can be
run WITH syntax error and WITHOUT the variables being declared because the
program is compiled as it is being executed. So, if a line is not used, it is not
compiled. If it has an error in it, the computer doesn’t see it.
18
UNIT 3 – Talk to Me
To give you an example, let’s say you were on the top floor of a six-story building
(see illustration below):
YOU Ukrainian
САША Ukrainian, Polish
ANDRZEJ Polish, German
HELGA German, French
FRANÇOIS French, English
JOHN English
Unfortunately, you know only Ukrainian and JOHN knows only English. But your
friend САША knows Ukrainian and Polish, and he knows ANDRZEJ who knows
Polish and German, and so on.
In interpreted languages, you send the message down one line at a time to the CPU.
In compiled languages, you send the entire message down at once. The CPU
performs the command and goes to the next line. In a compiled program, the next
line is there. In an interpreted program, the CPU must wait for the next line to reach it
in machine.
Interestingly, this same idea in the basis for the Open Systems Interconnection
model (OSI model) - a conceptual model that characterizes and standardizes the
communication functions of telecommunication.
FACTOID: If you would like to see how computer languages developed, the
complexity of the development, and the major data structures of each, please go to:
http://www.digibarn.com/collections/posters/tongues/ComputerLanguagesChart-med.png
To look at how different languages handle the same task, let’s look at the iconic
“Hello World!” program that prints that phrase to the screen.
19
UNIT 3 – Talk to Me
BASIC (interpreted)
PASCAL (compiled)
Program HelloWorld(output);
begin
writeln('Hello, world!');
end.
C (compiled)
#include<stdio.h>
main()
{
printf("Hello World!");
JAVA (compiled)
PHP (interpreted)
<?php
echo "Hello World!";
?>
As you can see, each language expresses the same command in different ways with
some similarities. How does this relate to the CPU, which must run the program? As
was mentioned earlier, regardless of the type of language (compiled or interpreted),
the CPU can only run it in machine language. None of these are machine language.
They must be translated, interpreted, and compiled into machine language like the
illustration above.
20
UNIT 3 – Talk to Me
VOCABULARY
TECHNICAL NON-TECHNICAL
attribute - якість; властивість; символ; атрибут; basis – базис, основа \
характерна риса основание, фундамент
/качество; свойство; символ; атрибут; характерная
черта
Boolean - логічне, булеве значення /логическое, complex –
булевое значение складний/сложный
compile (v) – скласти/ компилировать condition -
умова/условие
conventional machine language - звичайна машинна entire – цілий/весь,
мова/ обычный машинный язык
data structure - структура даних/ структура данных function – функція/
функция
declare (v) – декларувати/ объявлять iconic – іконічний /
иконический
discrete – дискретний/ дискретный in demand – мати попит
\ быть востребованным,
пользоваться спросом
entity - компонент, об'єкт /компонент, объект illustration – ілюстрація/
иллюстрация
execute (v) – виконати/ выполнять task – завдання/ задача
inherit (v) – успадкувати/ унаследовать time-consuming –
трудомісткий/
трудоемкий
instance - реалізація /реализация
integer - ціле число /целое число
interpret (v) – тлумачити/ интерпретировать
microassembly language (MAL) - мікроскладальна
мова; мова асемблера / язык ассемблера
object - об'єкт/ объект
object-oriented - об'єктно-орієнтований/ объектно-
ориентированный
procedural – процедурний/ процедурный
property – властивість/ свойство
syntax – синтаксис/ синтаксис
translate (v) - перекладати, перетворювати/
переводить, преобразовывать
variable – змінна/ переменная
21
UNIT 3 – Talk to Me
ACTIVITIES:
1) Look at the “Hello World!” program illustrations above. Which do you think
would be easiest for you to write and why?
2) Pick a computer language you would like to program in and describe that
language to include: Is it procedural or object-oriented? Is it compiled or
interpreted? What are the major data structures of the language? Why
do you want to learn it?
3) What computer language(s) do you know, what do you use them for, and
why did you learn them?
4) Research what computer languages are in demand now and how you plan to
learn them (or at least one of them).
Vocabulary exercises
22
UNIT 3 – Talk to Me
Exercise 2. Fill in the blanks with the words / phrases from the Unit.
1) You'll lose marks if you _____________ from one language into another
too literally.
2) Working ____________________ here are primitive.
3) Producing a computer program is a very __________________________ job.
4) John Lennon gained _______________ status following his death.
5) I'm not quite sure what my _______________ is within the company.
6) He spent the _______________ afternoon playing a computer game.
7) We usually ask freshmen to perform a few simple tasks just to test their level of
the English language.
1) OO
2) PHP
3) OSI
1. The following presentation / essay takes a look at both sides of the argument.
2. Needless to say, …
3. Furthermore,
4. In addition, …
5. What is more, …
6. On top of that, …
7. In general, …
8. By and large, …
9. … any questions?
23
UNIT 3 – Talk to Me
Supplementary activities
Grammar
Exercise 5. Focus on the Modal Verbs. Read the text of the lesson one
more time and underline the Modals (Homework).
2. Possibility - She can pass the exam. (90% - He could have been killed in the
certain) accident. (Luckily, he wasn’t
- They could still be at university. killed.)
(50% certain; it’s possible they
are still at university.)
- The students may be studying
in the reading room. (perhaps;
50% certain; it’s possible that - She may have seen Ann
they are studying.) yesterday.
- We might need some more (Perhaps she saw Ann.)
water. (40% certain; perhaps we
need some more water.)
- It is likely that she will phone - She might have forgotten.
tonight. (Perhaps she has forgotten.)
- She is likely to phone tonight.
- It was likely that she had
phoned the day before.
- She was likely to have phoned
the day before.
24
UNIT 3 – Talk to Me
- She should get the credit - They should have sent the
easily. (90% certain; future parcel by now. (They have
only; she’ll get easily.) probably sent it by now.)
- He ought to be at the - He ought to have arrived half
college by now. (90 % certain; an hour ago. (He has probably
he will probably be home.) arrived.)
25
UNIT 3 – Talk to Me
6. Necessity/ - I must find a new job. - I had to find a new job. (I was
absence of (I say so.) obliged to.)
- She has to wear the uniform. - Since her car was being
necessity
(necessity coming from repaired, she had to go to Kyiv by
outside the speaker) bus.
- We’ve got to leave now.
(informal)
- The classroom needs - We had to go to work yesterday.
repairing. OR The classroom
needs to be repaired. (It’s - The classroom needed
necessary) repairing. OR The classroom
- They don’t have to/don’t needed to be repaired. (it was
need/needn’t take notes if necessary)
they don’t want to. (it isn’t
necessary – absence of - They didn’t have to take notes.
necessity) (it wasn’t necessary – absence of
- I ought to get my hair cut. necessity)
(it’s necessary) - They didn’t have to/didn’t need
to come early. (It wasn’t
necessary for them to come early
and they didn’t.)
- She needn’t have come on
Saturday. (It wasn’t necessary for
her to come on Saturday but she
did.)
7. Advice - You should eat less fast - I should have handed that
food. (general advice; I advise assignment in on time. (but I
you) didn’t)
- We ought to be ready to
obtain new skills. (most people - She ought to have gone to bed
believe this, I advise you) earlier. (but she didn’t)
- You had better come on
time. (it’s a good idea; advice - The project would have been
on a specific situation) cleaner if we had used some
- Shall I take this course? cardboard. (but we didn’t)
(asking for advice)
26
UNIT 3 – Talk to Me
9. Obligation - I must care about it. (I’m - I had to care about it last night.
obliged to; I say so.)
- I have to care about it. (I’m - I had to care about it last night.
obliged to; the boss says so.)
- They ought to care about - They ought to have cared about
their pets. (It’s the right thing to their pets. (It was the right thing to
do but they don’t always do it.) do but they didn’t do it.)
13. Prohibition - You can’t use mobile phones - They couldn’t use mobile
here. (you aren’t allowed to) phones there. (they weren’t
allowed)
- You mustn’t use mobile ________
phones here. (it’s forbidden)
- You may not use mobile ________
phones here. (formal)
14. Duty - Everybody must obey the - All the people had to obey the
rules. rules.
- Everyone ought to save - She ought to have saved the
natural resources. (It’s the natural resources. (It was the right
right thing to do but they do thing to do but she didn’t do it.)
not always do it.)
27