Студопедия

КАТЕГОРИИ:

АстрономияБиологияГеографияДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРиторикаСоциологияСпортСтроительствоТехнологияФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника


Defining the Problem




The first step in developing a computer program is determining exactly what it is that you want the computer program to do. What tasks will it perform? What kind of data will it use. and where will it get its data from? What will be the output of the program? How will the program interact with the computer user? Answering these questions, and thereby defining exactly what you want the computer to do, is what we call defining the problem.

To define the problem, programmers meet with the intended users to develop the program's objectives. The resulting outline includes information about what the output should look like, what kind of data the program will use as input, and the processing requirements (how the data will be manipulated and what kind of hardware will be used to run the application). The more information programmers can learn at the beginning of the programming process, and the more specific that information is. the more likely the resulting application will meet users' needs.


 




To help in defining the problem, users are also asked to draw a picture of how they wish the final output to appear. The programmer can then begin to plan what input, data, and processing are necessary to get the desired results from the application.

Constructing the Algorithm

An algorithm is a prescribed set of well-defined instructions for solving a problem in a finite number of steps. The programmer, knowing how a microcomputer works, decides how data must be entered, how they must be processed, and how the data must be presented to produce the required output. The algorithm spells out when the computer is to start and stop the program, where input is needed, where output is needed, when to perform arithmetic operations, and when to perform comparison operations. It also indicates what the microcomputer is to do if certain answers are derived from these operations.

In constructing the algorithm, programmers use the techniques of top-down design. Top-down design is the process of starting with the most general outline of how the algorithm will work, refining it by sketching in the details on smaller and smaller scales. Once a general outline is constructed, the programmer treats each of the steps as another algorithm to be developed and thus creates an algorithm for executing all the steps in the general outline.

Coding

Coding is the process of translating the algorithm into the syntax (grammar) of a given programming language. In developing its programs, a software publishing company often specifies that its programmers must use a particular language, especially as most major applications are a group effort that involves many programmers, independent software developers often choose a favorite language to work with for most of their projects. In some cases (such as a program developed for a specific client), which programming language to use is decided according to the needs of the user, who may refine or modify the program later. When possible, the decision should be made objectively: different programming languages have their strong and weak points that make them better for some programming tasks, worse for others. In any case, selecting a programming language is a crucial decision in the program development cycle.


Testing and Debugging

Program testing means running the program, executing all its instructions, and testing its logic by entering sample data to check the output. Debugging is the process of finding and correcting program code mistakes. The term comes from an episode in the early days of modern computing when programmers for the Mark I computer in1945 were trying to discover why their program didn't work. Examining the computer, they found a moth stuck between the contacts of an electrical relay. Nowadays any error in code is called a bug. Two general types of errors are syntax errors and logic errors.

A syntax error is atransgression (breaking) of the grammar rules of the programming language. As will all languages, programming languages have rules of grammar. A programming language's grammar is stricter than most languages, however, and any deviation from the rules causes a program to not work.

A logic error is atransgression of the basic logic structure. It can involve missing a step in the algorithm, having an error in the algorithm's logic structure, using an erroneous formula, or any number of other subtle problems with the design or executing or the program steps. If the microcomputer cannot follow the logic, at some point the program will not operate properly. Logic errors can be so serious that entire programs must be redone.

Ш » Задание 8. Выберите один из предложенных научно-технических текстов и выполните следующие задания:

1. Сделайте предпереводческий анализ текста.

2. Письменно переведите отрывок (800-900 печатных знаков) текста.


Поделиться:

Дата добавления: 2015-09-15; просмотров: 50; Мы поможем в написании вашей работы!; Нарушение авторских прав





lektsii.com - Лекции.Ком - 2014-2024 год. (0.006 сек.) Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав
Главная страница Случайная страница Контакты