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



Download 272.18 Kb.
Page1/5
Date03.05.2017
Size272.18 Kb.
#17077
  1   2   3   4   5
Unit 1. Computer Programming

Warm-up
Task 1. What do you know about programming? Answer the Internet Quiz.


  1. When creating a computer program, the _____ designs the structure of the program.

  1. end user

  2. systems analyst

  3. programmer

  4. all of the above

  5. none of the above




  1. Checking a computer program for errors is called _____.

  1. bugging

  2. debugging

  3. correcting

  4. syntaxing




  1. The computer itself uses _____ language.

  1. natural

  2. assembly

  3. machine

  4. high-level

  5. none of the above




  1. The language which is best for mathematical models is _____.

  1. FORTRAN

  2. BASIC

  3. Java

  4. C

  5. COBOL




  1. The term BASIC is an acronym for _____.

  1. Balanced Assembly System Integrated Code

  2. Basic All System Internal Code

  3. Beginner's Assembly Syntax Instruction Code

  4. Beginner's All-purpose Symbolic Instruction Code




  1. A programming language which looks like normal English is a(n) _____ language.

  1. normal

  2. high-level

  3. natural

  4. 4GL

7. The process of writing the computer instructions is called _____.



  1. coding

  2. compiling

  3. debugging

  4. interpreting

8. The most widely used language for business programs is _____.



  1. FORTRAN

  2. BASIC

  3. Java

  4. C

  5. COBOL

9. The _____ must decide what a new program is to accomplish.



  1. end user

  2. systems analyst

  3. programmer

  4. supervisor

10. Documentation of computer programs is important so that _____.



  1. users can learn how to use the program

  2. other programmers can know how to maintain the program

  3. the programmer can see why the code is written that way while hunting for sources of error

  4. all of the above

  5. a and b only



Listening
Task 2. Programmers sometimes use flowcharts when planning a program. Listen to the recording and identify these symbols used in flowcharts. Four symbols are not mentioned.


a) ________________ b) _________________ c) _______________





d) ________________ e) _________________ f) _______________






g) ________________ h) _________________ i) _______________




Task 3. Listen again to the recording and write below a typical example of an instruction often found there in flowcharts. One symbol has no words.


      1. _____________________________________________________________________

      2. _____________________________________________________________________

      3. _____________________________________________________________________

      4. _____________________________________________________________________

      5. _____________________________________________________________________


Reading
Task 4. Look at the algorithmic flowchart on the next page and answer the questions.


        1. Which computer commands does it show?

        2. How many decisions does the computer make?

        3. After the user clicks Save, how many times does the user input data?

        4. How many ways of developing the events are possible here?

        5. In what case will the program be completed in the shortest way?


Now describe this algorithmic flowchart.



The program reads the file name, format and location.








YES





NO











Program reads the file name, format and location.











YES




NO













Task 5. Read the text about computer programming. Write the number of the paragraph that gives you the information.


  1. why high-level languages are easy to learn _____

  2. a description of machine language _____

  3. the greatest problem for computer programmers _____

  4. the names of three high-level computer languages _____

  5. a description of an algorithm _____

  6. different uses of computers in our lives _____

  7. a description of a computer program _____

  8. what computers do with code _____

  9. a description of the binary system _____




  1. The diagram above shows part of a simple algorithmic flow chart for the Save command in a computer program. An algorithm is a set of logical rules that we use to solve a problem. Computer programmers often use algorithms to plan their programs, but the only language a computer understands without translation is machine language. This uses the binary system of 1 and 0, which matches the electrical positions ‘on’ and ‘off’. We can also show these numbers in English by Yes/No or True/False.




  1. Machine language is a low-level language and is very difficult to write. Over the years, computer scientists have developed many high-level languages, such as BASIC, C++ and Java. These languages use a computer code that is similar to English, which makes them easier to learn. A computer program is just a set of coded instructions. A computer translates the code into machine language to complete a specific task. A computer receives input, processes data and produces results, or output, according to the program code.




  1. We use computers in many parts of our lives, and not just in schools or for the Internet. There are computers in all kinds of electrical devices, from mobile phones to washing machines. We can find them in banks, supermarkets and cars. When programmers write programs, they have to plan carefully for every possible kind of error a computer user can input into the computer. It is planning for the random behaviour of humans that makes programming so much fun.


Speaking
Task. 6. Work in groups and discuss the following questions.


  1. Have you ever had any problems with the computer?

  2. What kind of errors do you make with computers?

  3. How do you behave when things go wrong with a computer?


Listening
Task 7. Listen to the interview with Colin who is a programmer and answer these questions.


  1. Is programming stressful?

  2. What does Colin do as a break from programming?

  3. Where do the team do much of the design work?

  4. How many people are there in the team?

  5. What do they do?

  6. How long did Dante take to write?

  7. Why was it easy to split?

  8. What languages does he mention?

  9. How does he keep up with developments in his field?

  10. Why does he hate to go home sometimes?


Reading
Task 8. Work in groups of three: A, B and C. Read your text on the next page and complete the table.





Text A

Text B

Text C

Type of error












Definition












Example













Ways to avoid or deal with this kind of error










  1. System errors affect the computer or its peripherals. For example, you might have written a program which needs access to a printer. If there is no printer present when you run the program the computer will produce a system error message. Sometimes a system error makes the computer stop working altogether and you will have to restart the computer. A sensible way of avoiding system errors is to write code to check that peripherals are present before any data is sent to it. Then the computer would warn you by a simple message on the screen, like ‘printer is not ready or available’.




  1. Syntax errors are mistakes in the programming language (like typing PRNIT instead of PRINT). Syntax errors cause the program to fail. Some translator programs won’t accept any line that has syntax errors. Some only report a syntax error when they run the program. Some languages also contain special commands such as debug, which will report structural errors in a program. The programming manual for the particular language you’re using will give details of what each error message means.




  1. Logic errors are much more difficult to detect than syntax errors. This is because a program containing logic errors will run, but it won’t work properly. For example, you might write a program to clear the screen and then print ‘hello’. Here is a code for this:

10// Message

20 PRINT ‘Hello’

30 CLS


40 END
The code has a logic error in it, but the syntax is right so it will run. You can get rid of logic errors from simple programs by ‘hand-testing’ them or doing a ‘dry run’ which means working through each line of the program on paper to make sure it does what you want it to do. You should do this long before you type in the code.
Task 9. Now share information orally about your text with others in your group to complete the table for each of the errors described.
Writing
Task 10. Draw a flowchart like one in Task 4 for one of these activities. Follow these steps:


  • Choose a simple procedure from the ones in the box below (or a simple one of your own).

  • Break the procedure down into all the steps that you have to follow. Think about where the process starts and ends, and the input from you and from the outside. When you make a decision, think of when you say ‘yes’ and when you say ‘no’, and what happens next.

  • Write exactly what happens at each stage.

  • Draw the flowchart, putting your text into the different shapes in Task 2.

  • Show your flowchart to another student. Does he/she agree with your steps?



Making a cup of tea or coffee

Making a telephone call

Sending a text message

Answering the door



Planning a holiday

Choosing a new computer

Preparing for an important exam

Playing a cassette or a CD




Speaking
Task 11. Read the quotations about ‘programming’ below. Discuss with other students what point you think each quotation is trying to make and whether you agree with it.


  1. Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)

  2. To understand a program you must become both the machine and the program. (Alan J. Perlis)

  3. Perhaps if we wrote programs from childhood on, as adults we'd be able to read them. (Alan J. Perlis)

  4. Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)

  5. “There are two ways to write error-free programs; only the third one works.” (Alan J. Perlis)

  6. “Don’t worry if it doesn’t work right.  If everything did, you’d be out of a job.”
    (Mosher’s law of software engineering)

  7. It is easier to change the specification to fit the program than vice versa. (Unknown)

  8. Most people find the concept of programming obvious, but the doing impossible. (Alan J. Perlis)

  9. One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. (Elbert Hubbard)

  10. Those parts of the system that you can hit with a hammer are called hardware; those program instructions that you can only curse at are called software. (Anonymous)

  11. Any given program costs more, and takes longer. (Computer law)

  12. The most harmful error of any program will not be discovered until the program has been in production for at least six months. (Troutman's programming postulates)

  13. Profanity is the one language that all programmers know the syntax of. (Troutman's programming postulates)

  14. Real programmers never work from 9 to 5. If any real programmer is around at 9 a.m., it’s because they were up all night. (Some computer geek)

Unit 2. Program Design
Warm-up
Task 1. In pairs, try to think of an answer for the question:
What is programming?
Decide which of the definitions below is the most appropriate? Give a reason for your choice.




  1. The process of writing and testing programs for computers.

  2. The process by which a set of instructions is produced for a computer to make it perform a specified task. The task can be anything from the solution to a mathematical problem to the production of a graphics package.

  3. The act of writing a computer program.

  4. The craft of implementing one or more interrelated abstract algorithms using a particular programming language to produce a concrete computer program. Programming has elements of art, science, mathematics, and engineering.

  1. A pastime similar to banging one's head against a wall, but with fewer opportunities for reward.


Reading
Task 2. Put these five stages of programming in the correct sequence.


  1. Design a solution 1. _____

  2. Code the program 2. _____

  3. Document and maintain the program 3. _____

  4. Clarify the problem 4. _____

  5. Test the program 5. _____


Task 3. To which stage does each of these steps belong?


  1. Clarify objectives and users _____

  2. Debug the program _____

  3. Write programmer documentation _____

  4. Do a structured walkthrough _____

  5. Select the appropriate programming language _____


Task 4. Read the text and compare your answers for Tasks 2 and 3.
Steps in Computer Program Development


The steps in the development of each of the computer programs that make up the computer program component of a system are:



  1. define the function of the program;

  2. plan the logic of the program;

  3. code the program;

  4. test and debug the program;

  5. complete the documentation.

Although the programmer is responsible for



writing the computer program, the system analyst must communicate the computer program requirements to the programmer. The function of each program was defined for the programmer when functions were allocated during system design. Detailed data flow diagrams (DFD) are prepared for each program from the decomposed DFDs created during the design phase. These DFDs define the function of each program.

In program planning, the logic to be used to solve the problem is developed. Algorithms, computer program logic flowcharts, and structure charts are useful tools for program planning. Algorithms are sets of rules or instructions used to accomplish tasks. They may be stated as formulas, decision tables, or narratives.

The next step, writing, or coding, a program, is the actual writing of computer instructions. These instructions will be translated to machine code and followed by the computer; they should follow the steps of the program logic plan.

Several programming languages, particularly COBOL, PL/I, and RPG, are commonly used to solve business problems. In addition to these traditional languages, organizations using database management systems may choose to generate programs using the query language of the DBMS. These query languages are part of a package of programming tools known as fourth-generation languages. Each language has its advantages and disadvantages. Most computer installations have a standard language used by their programmers. Programmers usually are not given a choice of language unless some special circumstances exist.

Testing and debugging a program involve:


  1. translating the coded program into machine language, a process called compilation;

  2. testing the translated program with sample data and checking the result.

If the results of testing are not correct, the program is said to have "bugs". Debugging is the process of correcting computer programs to obtain correct results.

The last step is to complete the documentation for the program. The documentation must include a statement of the purpose of the program, a description of the solution logic, a listing of the program instructions, and sample outputs from the completed programs. Information provided to the programmer by the analyst, such as descriptions of program inputs, outputs, and files, should be included. Instructions to operators explaining how the program is to be used must be written before the program documentation is completed.



Language work


General and Special Questions

Word order in general questions: auxiliary verb + subject + verb

e.g. Have you ever used a computer?

Word order in special questions is as following:



question word + auxiliary verb + subject + verb

e.g. How long have you been restoring the data?

If there is more than one auxiliary verb, we put only the first auxiliary in front of the subject:

e.g. How long has this program been used?





Task 5. There are answers to questions about the text. Write the questions.


  1. There are five main steps in the computer program development.

  2. For writing the computer program.

  3. It is developed in program planning.

  4. As formulas, decision tables, or narratives.

  5. Yes, it is the actual writing of computer instructions.

  6. No, programmers usually are not given a choice of languages.

  7. It is called compilation.

  8. When the results of testing are not correct.

  9. To obtain correct results.

  10. They must be written before the program documentation is complete.


Task 6. Choose the correct word to complete each sentence. You may have to change some words slightly.


  1. compilation, compiler, compile, compiled

    1. It took weeks __________ the new customer database.

    2. A source program cannot be directly processed by the computer until it has been __________.

    3. If the errors are removed and the program re-run, the process of __________ starts all over again, but this time the __________ program will be executed.

    4. A computer needs its own __________ for the various high-level languages if it is expected to accept programs written in those languages.




  1. program, programmer, programming, programmable

    1. The __________ CD-player allows the user to change the order tracks are played in.

    2. She __________ the VCR to come on at eight.

    3. Most computer __________ make a plan of the program before they write it. This plan is called a flowchart.

    4. It is unusual for a __________ to work correctly the first time it is tested.

  2. bug, debug, debugger debugging

    1. The best compilers usually include an integrated __________ which detects syntax errors.

    2. New programs need __________ to make them work properly.

    3. Once you have written your program you have to test it with sample data to see if there are any __________ or errors.




  1. instruction, instruct, instructed, instructor

    1. The next step is to design an algorithm, which is a step-by-step plan of __________ used to solve the problem.

    2. We have been __________ that a decision will not be made before the end of the week.

    3. Our maths __________ explained to us the principles of binary arithmetic.


Speaking
Task 7. Say what has happened in the cartoon. What do you think this cartoon is about? Write a caption for the last picture. Translate each caption into English.


Как было предложено


организатором разработки

Как было описано в


техническом задании

Как было спроектировано


ведущим системным
специалистом


Как было реализовано
программистами


Как было внедрено



____________________

Task 8. Work in pairs and discuss the following:


  • Many would argue that computer’s actions are merely consequences of how it was programmed, and thus a computer cannot possess free will. In turn, a computer shouldn’t be held responsible for its actions.

  • Is human’s mind a computer?

  • Are humans programmed at birth?

  • Are humans responsible for their actions?


Writing
Task 9. Look at the scheme below and describe activities and connections of the evolutionary development.
Evolutionary development concurrent activities

Discuss whether it is possible for engineers to test their own programs in an objective ways.
Listening
Task 10. You will hear Lucy Boyd, a software developer, explaining how a program is produced. Listen and write down what you hear.
Translation
Task 11. Translate the following sentences into English.


  1. Если вам удалось написать программу, в которой транслятор не обнаружил ошибок, обратитесь к системному программисту – он исправит ошибки в трансляторе.

  2. В природе программирования лежит то, что нет соотношения между "размерами" самой ошибки и проблем, которые она влечет.

  3. Если отладка – процесс удаления ошибок, то программирование должно быть процессом их внесения.

  4. Машинная программа выполняет то, что вы приказали ей делать, а не то, что бы вы хотели, чтобы она делала.

  5. Сложность программы растет до тех пор, пока не превысит способности программиста.

  6. Если бы архитекторы строили здания так, как программисты пишут программы, то первый залетевший жук разрушил бы цивилизацию.

  7. Никогда не выявляйте в программе ошибки, если вы не знаете, что с ними делать дальше.

  8. Большинство существующих программ создается исключительно для нужд компьютера – для того, чтобы работало нужное человеку меньшинство.


Task 12. Work in pairs and translate the following poem by Gene Ziegler into Russian.
0A programmers
0A young programmers began to work online,

One didn’t pay for Internet, and then there were 9.


9 young programmers used copies that they made,

But one was caught by FBI, and then there were 8.


8 young programmers discussed about heaven,

One said, “It’s Windows 95”, and then there were 7.


7 young programmers found bugs they want to fix,

But one was fixed by the bug, and then there were 6.


6 young programmers were testing the hard drive,

One got the string “Format complete”, and then there were 5.


5 young programmers were running the FrontDoor,

The BBS of one was hacked, and then there were 4.


4 young programmers worked using only C,

One said some good about Pascal, and then there were 3.


3 young programmers didn’t know what to do,

One tried to call the on-line help, and then there were 2.


2 young programmers were testing what they done,

One got a virus in his brain, and then there were 1.


1 young programmer was as mighty as a hero,

But tried to speak with users, and then there were 0.


Boss cried: “Oh, where is the program we must have?!”

And fired one programmer, and then there were FF.



Unit 3. Programming Languages
Warm-up
Task 1. Read the saying below and mull it over in pairs.
Alan Perlis once said: “A language that does not affect the way you think about programming is not worth knowing”.
Task 2. Can you identify these programming languages?


A.
10 REM Program to compute integer sum

  1. MAXINT% = 32767

  1. TOTAL# = 0#

  1. PRINT “This program calculates the sum of all integers”

50 PRINT “from 1 to whatever integer you specify.”

60 PRINT “Enter any positive integer up to “MAXINT%”:”;

70 INPUT NUMBER

80 IF (NUMBER > 0) AND (NUMBER <= MAXINT) THEN GOTO 90 ELSE GOTO 150

90 FOR COUNT% = 1 TO NUMBER

100 TOTAL# = TOTAL# + COUNT%

110 NEXT COUNT%

120 PRINT “The sum of all integers from 1 to ”NUMBER

130 PRINT “is “TOTAL#

140 GOTO 160

150 PRINT “This number is out of bounds!”

160 END



B.
/*numbercount.c*/

#include

#define MAXINT 32767
main ()

{

int count, number;



long int total;
total = 0;

printf(“This program calculates the sum of all integers\n”);

printf(“from 1 to whatever integer you specify.\n”);

printf(“Enter any positive integer up to %d:”,MAXINT);

scanf(“%d”,&number);

if (number > 0 && number <= MAXINT)

for (count = 1; count <=number; count++)

total = total + count;

printf(“The sum of all integers from 1 to %d\n”,number);

printf(“is % d\n”,total);

else printf(This number is out of bounds! \n”);

}


C.
Program Number Count (input, output);
var count,

number: integer;

total: real;
begin

total :=0.0;

write|n (‘This program calculates the sum of all integers’);

write|n (‘from 1 to whatever integer you specify.’);

write (‘Enter any positive integer up to ’,maxint,’:’);

read|n (number);

if (number > 0) and (number <=maxint) then

begin


for count = 1 to number do

total := total + count;

write|n (‘The sum of all integers from 1 to ‘,number);

write|n (‘is ‘,total)

end

else writein (‘This number is out of bounds!’)



end.


Reading
Task 3. Read the text and fill in the gaps using the list of words below.


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