1. Unit 6: Programming Languages
Edgar Fernando Chaves Gutiérrez
Code: 084800712017
José Alberto Céspedes Mape
Code: 084800242017
José Martin Sánchez Cardoso
Code: 084800602017
Juan Sebastián Botero
Code: 084800752017
August 2017
University of Tolima
Technology in Database Management.
English Expression
2. UNIT 6: PROGRAMMING LANGUAGES
6.1. WARM-UP
Below are some languages. Which ones are computer languages?:
Logo Hindu Japanese Assembler Fortran
Esperanto Morse Code Semaphore Algebra Basic
Ans/Logo, Assembler, Fortran and Basic.
What other types of languages are there, apart from spoken languages like
English, French, etc. (Example: Music, Maths...)?
Ans/ Morse Code, Algebra, Semaphore, etc.
6.2. READING TEXT
B) Questions about the text:
1. What is the elementary language that computers work in called?
Ans/ The elementary language used in computers is the machine code.
2. Can you name a few natural languages?
ans/ Some natural languages are English, Spanish, Chinese, among others.
3. Is BASIC an example of a high level computing language?
Ans/ BASIC is a high level programming language, because it is a language that is
very similar to a natural language and the computer translates it to machine code.
4. What is a flow chart?
Ans/ It is like a diagram, and shows each of the steps that the computer has to
take, and the order in which the steps go.
5. What effect does a bug have on a program?
Ans/ Bugs or errors have the effect that a program does not work correctly, this
caused many programs not to start.
C) Complete these sentences:
1. Machine code is the way the computer works.
2. English, Spanish or Chinese are too complex for the computer.
3. Logo was invented with children particularly in mind.
4. BASIC stands for Beginner's All-purpose Symbolic Instruction Code.
3. 5. Most computer programmers make a plan of their program before they write
it.
6. When all the bugs have been corrected, the program will run.
6.3. MATCHING EXERCISE
A) Primero mire estos 3 breves ejemplos de lenguajes de programación.
B) Below there are three explanations of these programs. Which explanation goes
with which program?
(1) This is a short program in BASIC. Line 10 tells the computer to print <<What is
Your Name?>> on the screen. Then the computer stores your answer in its
memory and if your name is Jill, it print out a message to you.
(3) This program is written ins PASCAL, a language named after a famous French
,mathematician. It is part of a program to work out details about numbers. Many
people think it is easier to write good, neat programs in PASCAL than in BASIC.
(2)This is a language called COBOL. It is used to write programs for business and
requires a lot of memory. This program is part of a registration form. It is the most
widely used language on large computers. COBOL has just four arithmetic
functions built in: Add, subtract, Multiply, Divide.
6.4 PAIR WORK: Witting programs
4. The results you get from a computer depend on the instructions you give. So you
have to work out a sequence of steps for the computer to follow.
a) Natural Language. Here are some instructions to make a pot of coffee. The
order has been mixed up. Can you put the list of instructions in its correct order.
Write the number in their correct places.
(5) Heat the pot until the water boils.
(1) Put the ground coffee in the filter and place the filter in the bottom part of the
pot.
(7) Wait a couple of minutes.
(4)Put water into the bottom part of the pot.
(3)Screw the top half of the pot onto the bottom half.
(2) Ground the coffee.
(6)When the water boils remove the pot immediately.
(8)Serve the coffee (with milk and sugar if you like)
B) Now write instructions following the above example for one of the things below:
* How to use a pay telephone.
Need to call.
Know the telephone number.
Have money.
Leave the place where I am.
Get to the place.
Ask if there are minutes for the operator.
Dictate the number.
Wait for the call to come in.
Wait for him to answer the call.
Perform the greeting protocols of the call.
Communicate the message.
End the call.
Deliver the phone to the owner of the cell phone and wait for the cost of the
call.
Pay what is consumed.
*Hoe to prepare an omelette.
We take two eggs from the refrigerator and if we do not have it bought in the
market.
Break them, place their contents in a bowl and mix with a fork.
If you want we can add condiments like salt or oregano.
We put a frying pan in an hob with a little oil to heat.
We threw the eggs and left a few minutes.
Then we take it out and put it on a plate.
5. *How to use a washing machine.
Insert dirty laundry into the washer off.
Add detergent proportional to clothing.
Turn on the washing machine, select quick wash and select water level
depending on the amount of laundry.
Start the washing process, and wait for it to finish.
Leave clothes lying wherever there is no moisture and find soil that can get
wet, wait until the clothes dry (it can take between 1 hour or more,
depending on different factors such as light, etc.).
Once you dry the clothes, fold it and store it.
C) This a program in BASIC. It doesn't follow the right order. Can you organize it
properly (or machine will execute it wrongly and the program will not work).
The normal way to order a BASIC program is to give each instructions a line
number. Each one should be separated from the next by 10. So decide which
instruction comes first, and put 10 between the brackets. Then put 20 in the
second instruction, and so on.
() Print "what is your name?"
() Input Age
(10) cls
() Print "Hello; Name$; "you are "; Age
() Print "How old are you?"
(30) Input Name$
() Print "Bye, Bye"
() End
The order would be as follows:
(10) cls
(20) Print "what is your name?"
(30) Input Name$
(40) Print "How old are you?"
(50) Input Age
(60) Print "Hello; Name$; "you are "; Age
(70) Print "Bye, Bye"
(80) End
D) Here is a program in BASIC which has three mistakes, or <<bugs>> as they are
called. A program cannot run properly if it has bugs in it. Can you correct the
program? Where are the bugs?:
6. Ans/ According to my experience, the correct program would be as follows:
10 PRINT "HELLO!"
20 PRINT "THIS PROGRAM MAKES ADDITIONS"
30 PRINT "INTRODUCE NUMBER ONE = "
40 INPUT A
50 PRINT "INTRODUCE NUMBER TWO ="
60 INPUT B
70 C= A+B
80 PRINT "THE RESULT IS = ";C
90 END
The errors that the previous program had are:
In the second line of code it is necessary to close the sentence with a
quotation mark.
Inputs A and B were not in the correct position.
The operation of the add was badly raised.
6.6. VOCABULARY STUDY
A) look at the list of words bellow. Check that you understand them all, using a
dictionary if necessary.
B) Can you find the word in the above vocabulary list that best fits the following
descriptions?.
7. 1. An elliptical shape Oval.
2. A six-sided figure Hexagon.
3. A three-sided figure, whose angles add up to 180 Triangle.
4. Special identification number in computing Code.
5. A mistake in the program is a Bug.
6. Programmers before marking a program draw a Flow Chart.
6.7. GROUP WORK: Flow Charts
When you are writing a program it sometimes helps to draw a diagram which
shows the order or sequence of action that you want the computer to follow. A
diagram is called a flow chart. A flow chart has different shaped boxes that indicate
different procedures.
A) Shapes used in flow charts:
Can you mark with arrows the shapes with the words?
B) an example of a flow chart.
8. In your group can you do another flow chart for ONE of the situations bellow?
Using a computer; Buying a book; Ordering a meal in a restaurant.
Using Computer
10. C) Write the name of each shape according to function.
Oval terminal/start symbol.
Parallelogram input/output symbol.
Diamond decision.
Rectangle operation/process.
6.8. GRAMMAR WORK
* The present perfect tense
A) Answer the questions:
1. Have you ever written a computer program?
Ans/ Yes, I have written a computer program.
2. Have you ever had a Chinese meal?
Ans/ Yes, I have had a Chinese meal.
3. Have you ever kissed a gorilla?
Ans/ No, I haven't kiseed a gorilla.
4. Have you ever seen a shark?
Ans/No, I haven't seen a shark.
5. Have you ever ridden a Yamaha?
Ans/Yes, I have ridden a Yamaha.
B) Complete this dialogue. The first letter of each missing word has been provided:
a) Have you ever used BASIC to write a computer program?
b) Oh, yes I have.
a) What sort of program developed you write?
b) It wrote a program to play a simple game of space invaders.
Notice that the last question and answer are in the past tense.
In pairs, have similar small conversations.
<<Have you ever......?>> If your partner says <<Yes, I Have>>, continue the
conversation: <<When did you.....?>>
C) To find the bugs in a computer program and correct them is a very slow task.
11. Bugs can be typing mistakes, or errors in your program. Imagine that you are trying
to find a bug in your program, and your teacher is helping you. These are the
questions your teacher asks you:
<<Have you checked the program for typing mistakes?>>
<<Have you printed the program?>>
<<Have you started the program with a <<CLS>> command?>>
Now make more questions of this type.
Ans/ Have you written the program code well?
Have you checked if the program supports your computer?
Have you done a desktop test?