МИНИСТЕРСТВО
ОБЩЕГО И
ПРОФЕССИОНАЛЬНОГО
ЮБРАЗОВАНИЯ
РФ
ТАМБОВСКИЙ
ГОСУДАРСТВЕННЫЙ
ТЕХНИЧЕСКИЙ
УНИВЕРСИТЕТ
КАФЕДРА
ГАПС
Курсовая
работа
по информатике
Вариант
№2
Выполнил:
ст.гр.М-14 Топоз
А.В.
Проверил:
Краснянский
М.Н.
Тамбов
1999
Задание.
Разработать
программу для
построения
графика функции
y
= a-x.
Программа
должна:
обеспечивать
построение
графика заданной
функции на
экране ПК;
производить
масштабирование
аргумента и
значения функции;
строить
оси координат,
наносить на
них разметку
с определенной
дискретностью
и подписывать
их.;
обеспечивать
ввод коэффициентов
заданной функции
в диалоговом
режиме с клавиатуры,
а область значений
аргумента из
файла «dan.txt»;
выводить
значения функции
в файл «dat.txt»;
использовать
процедуру –
функцию для
определения
заданной функции;
использовать
процедуру –
подпрограмму
для построения
осей координат,
масштабной
сетки, масштабирования.
Описание
программы.
Для корректной
работы программы
необходимо
иметь в каталоге
бэйсика следующие
файлы:
KURS_T.BAS
DAN.TXT
После
входа в QuickBASIC
необходимо
открыть файл
KURS_T.BAS.
Для чего необходимо
нажать клавишу
«Alt»,
после чего в
верху диалогового
окна выделится
пункт меню
«Файл».
Далее необходимо
войти в него
нажатием клавиши
«Enter».
После нажатия
клавиши «Enter»
высветится
список подпунктов
из которых
необходимо
выбрать подпункт
«Открыть . . .»
с помощью клавиш
«»,
«Ї»
и нажать «Enter».
После
входа в подпункт
меню «Открыть
. . .» появится
окно со списком
файлов с расширением
*.BAS.
Для открытия
файла необходимо
нажать клавишу
«Tab»
и
выбрать клавишами
«»,
«Ї»
файл с названием
KURS_T
и
нажать клавишу
«Enter».
После
открытия файла
KURS_T
в
диалоговом
окне появится
текст программы.
Для запуска
программы
необходимо
нажать функциональную
клавишу F5,
а для перезапуска
программы
одновременное
нажатие клавиш
«Shift»
+ F5.
После
окончания
работы программы
необходимо
выйти из бейсика,
для чего необходимо
войти в пункт
меню «Файл»
и подпункт
«Выход».
Основным
модулем программы
является файл
KURS_T.BAS
состоящий
из главной
программы,
процедуры –
подпрограммы
и процедуры
– функции.
Главная
программа
осуществляет
обращение к
файлам, управление
процедурами
и построение
графика заданной
функции.
Процедура
– подпрограмма
осуществляет
построение
координатной
сетки и ее разметки.
Процедура
– функция позволяет
рассчитать
значение заданной
функции.
Файл
DAN.TXT
необходим
для ввода из
него интервала
изменения х.
После
завершения
программы
появляется
файл DAT.TXT
в
котором находятся
значения функции.
Текст
программы
DECLARE SUB xoy (d!, t!, a!, b!)
DECLARE FUNCTION y! (b!, a1!)
CLS : SCREEN 9
COLOR 10
PRINT "
- x"
PRINT "Функция
у = а"
INPUT "Введите
коэффициент
a"; a1
n$ = "dan.txt"
OPEN n$ FOR INPUT AS #1
INPUT #1, a: INPUT #1,
b: PRINT "x э ["; a; ","; b; "]"
CLOSE
i1 = 0: d = (300 * a) /
b
DIM y1(1400)
FOR i = a TO b
i1 = i1 + 1
y1(i1) = y(i, a1):
'PRINT y1(i1)
NEXT i
i1 = 0
t = y1(1)
d1 = 160 / y1(1)
CALL xoy(d, t, a, b)
OPEN "dat.txt"
FOR OUTPUT AS #2
PRINT #2, "
- x"
PRINT #2, "Функция
y = "; a1
PRINT #2, "x э
["; a; ", "; b; "]"
FOR i = a TO b
i1 = i1 + 1
PRINT #2, "y(";
i; ")= "; y1(i)
NEXT i
CLOSE
PSET (300 + d, 175 -
y1(1) * d1)
FOR i = a + 1 TO b
LINE -(300 + i * d, 175
- y1(i) * d1)
NEXT i
END
SUB xoy (d, t, a, b)
LINE (300, 180)-(300,
0), 10
LINE (290, 175)-(650,
175), 10
FOR mx = 300 TO 625 STEP
d
LINE (mx, 175)-(mx, 10),
3
NEXT mx
FOR my = 175 TO 10 STEP
-16
LINE (300, my)-(625,
my), 3
NEXT my
COLOR 13: LOCATE 1, 37:
PRINT "y"
COLOR 13: LOCATE 14, 78:
PRINT "x"
LOCATE 14, 35: PRINT 0:
LOCATE 14, 74: PRINT b
LOCATE 2, 33: PRINT t
END SUB
FUNCTION y (b, a1)
y = a1 ^ (-b)
END FUNCTION
Вариант
задания.
Вариант
№ 2, I
четверть.
-
x
Функция
y = 2
x
э [ 2 , 20 ]
y(
2 )= .125
y(
3 )= .0625
y(
4 )= .03125
y(
5 )= .015625
y(
6 )= .0078125
y(
7 )= 3.90625E-03
y(
8 )= 1.953125E-03
y(
9 )= 9.765625E-04
y(
10 )= 4.882813E-04
y(
11 )= 2.441406E-04
y(
12 )= 1.220703E-04
y(
13 )= 6.103516E-05
y(
14 )= 3.051758E-05
y(
15 )= 1.525879E-05
y(
16 )= 7.629395E-06
y(
17 )= 3.814697E-06
y(
18 )= 1.907349E-06
y(
19 )= 9.536743E-07
y(
20 )=
1.563283E-08
Список
используемой
литературы.
Т.Н. Быля,
О.И. Быля «Изучаем
информатику,
программируя
на Бэйсике»,
издание 2-е,
исправленное,
«Айрис рольф»,
1997.
Другие работы по теме:
Basic Iseals Of Declaration Of Independance Essay
, Research Paper The introduction to the Declaration of Independence posses the basic of ideals of America. Four of the ideals extolled in the document are; equality, natural rights, consent if the
Why Cells Are Small Essay Research Paper
Cells are the basic structural and functional units of life. As life on earth has evolved into organisms of varying complexities, two basic laws of nature have dictated why cells have remained so small.
The Question Of Nature Or Nurture Essay
, Research Paper Nature or Nurture? In psychology, both in the past and present, there has been a search for an answer to the question of how our personalities and behaviors are formed. There are two major hypotheses that attempt to answer this question. The first holds that our personality is determined by our genetic makeup.
The Three Basic Laws Of Chemis Essay
, Research Paper John Dalton was born in 1766 and died in 1844. Around 1803 he developed the first atomic theory of matter. He was a meteorologist and was very important to study of chemistry. Dalton discovered the three basic laws of chemistry. The law of conservation of mass, The law of definite proportions, and The law of multiple proportions.
Playwrights Aeschylus Sophocles And Euripides Essay Research
Paper The starting point when discussing comedy and tragedy would be to define the main terms. Comedy is the dramatic genre that focuses on human weakness through humor. Comedy celebrates the regeneration of life through love and reconciliation. Tragedy is the dramatic genre initiated by ancient Greek playwrights such as Aeschylus, Sophocles, and Euripides.
Gelatin Essay Research Paper Basic Public SpeakingGelatin
Gelatin Essay, Research Paper Basic Public Speaking Gelatin What can you do with ten tons of glow in the dark gelatin? Our company was approached with this question and has discovered that there are a number of useful products that can be produced from glowing gelatin.
Essay Why Its Good Essay Research Paper
My future as an architect. That is now my goal that I hope to reach hopefully very soon, at first I hadn?t considered architecture has a career. When I started high school I was really thinking about becoming a chef because I like to make my own creation in food but then I changed my mind when I explored drafting now I can still design or create but only now in house which is more interesting.
Our Lives Are Wasted By Detail Essay
, Research Paper OUR LIVES ARE WASTED AWAY BY DETAIL Thoreau believes that we fill our lives with to many details and luxuries. Thoreau tells us to only live with what we need to get through our lives, our lives would move more splendidly and flawlessly. Live your lives as simply as possible and you will be have much more satisfaction in life.
A World With No Rules Essay Research
Paper Today the Government provides many of the things that is did two hundred years ago. I lets us live freely without worrying about our basic human rights being infringed upon. Without any form of government I think two possible societies could emerge.
Cells Essay Research Paper CellsCells are some
Cells Essay, Research Paper Cells Cells are some of the smallest organisms around. All living things consist of cells, and yet they are invisible to the naked eye. How and why are they so small? Well, cells are the basic structural and functional units of life. As life on earth has evolved into organisms of different species and living things, two basic laws of nature have dictated why cells have remained so small.
Basic Marketing Essay Research Paper MarketingAccording to
Basic Marketing Essay, Research Paper Marketing According to the American Heritage Dictionary, marketing defined is the act or process of buying and selling in a market, but what are some of the strategies that successful corporations use to gain an advantage over their competition? Successful companies invest up front to develop an advertising and promotions plan, which clearly outlines the goals and strategies of the organization.
Religions 2 Essay Research Paper Global History
Religions 2 Essay, Research Paper Global History 9 March 23rd 1999 In the world today there are three major religions, Christianity, Judaism, and Islam. Each having the same background but having different views of this religion. These religions all have originated from the same area, the Middle East, and each having branched out from there.
Ten Commandments As A Basis For All
Societies Essay, Research Paper Mostly, The 10 commandments are basic, obvious things which people need to abide by for society to work. The final four Commandments are essentials for a
Mechanical Enginearing Essay Research Paper Mechanical Engineering
Mechanical Enginearing Essay, Research Paper Mechanical Engineering Mechanical engineering has two basic parts. The first, which is the base for mechanical engineering, is the field of engineering itself. The second part is the specialized branch which in this case is mechanical.
Abolishing Mandatory Attendance For Schools Essay Research
Paper “So that nobody has to go to school if they don’t want to”, by Roger Sipher states that compulsory attendance laws should be abolished. His argument is that students that don’t wish to be in school are antagonistic to the school and prevent others form learning, and therefore not be forced to attend school.
Antigone Civil Disobedience Essay Research Paper The
Antigone: Civil Disobedience Essay, Research Paper The short play, Antigone, was written in 441 B.C. by the Greek playwrightSophocles. It deals with some of the most basic problems that affect a society.One of them is Civil Disobedience. Civil Disobedience both a right andresponsibility of a person to fight an unjust law.
Metric System Essay Research Paper Metric SystemThe
Metric System Essay, Research Paper Metric System The Metric System, also known as the System Internationale (SI) was developed in France in 1799. The Metric System was created because the French and English were not in agreement politically, therefore the French did not want anything to do with the English including their system of measurements.
Basic Html Essay Research Paper There are
Basic Html Essay, Research Paper There are six basic steps you must follow in order to create a web page in HTML. For those who don t know what it HTML is, it is the coding language that is used to create, develop, and maintain these WebPages such as Yahoo, MSN, Altavista, etc. Although there are other complex languages such as XML and DHTML, they are derived from the basics of HTML.
Huck Finn The Problem With The Human
Race! Essay, Research Paper You are Twain. Create a paragraph that begins: The basic problem with the human race is Use Examples from FINN and the present!
Understanding Basic Midi Essay Research Paper Understanding
Understanding Basic Midi Essay, Research Paper Understanding Basic MIDI This article was designed to give you a basic understanding of the Musical Instrument Digital Interface (MIDI), and to leave you with a brief knowledge of it’s past. It is a tool widely used today in many varied recording or live preformance situations.
Recreational Use Of Drugs Essay Research Paper
The Recreational Use of Drugs “Junk yields a basic formula of “evil” virus: “The Algebra of Need”. The face of “evil” is always the face of total need. A dope fiend is a man in total need of dope. Beyond a certain frequency need knows absolutely no limit or control. In the words of total need: “wouldn’t you?” Yes you would.
Cell Theroy Essay Research Paper The cell
Cell Theroy Essay, Research Paper The cell theroy is made up of three main ideas: 1. All organisms are composed of one or more cells. An organism may be a single cell, such as the organisms Van Leewenhoek saw in water. Others, like most of the plants and animals with which you are most familiar, are multicellular, or made up of cells.
Basic TrainingMen And Women Together Essay Research
Paper Should Men and Women Take Basic Training Together The Untied States Armed Forces consist of the Army, Navy, Air Force, and Marines; it has been in existence for many years. The first step of military life once someone joins is basic training. Just as the name implies, it is here where a recruit learns the first skills of being a warrior and how to fight battles.
Process Of Web Page Development Essay Research
Paper Motivator sentence: The development and design of a basic web page can be a fun yet tricky task. Thesis sentence: Whether it’s a large commercial web-site for business purposes, or a small personal web page about your hobby or family; the process of development is the same. Blueprint sentence: The three major steps leading to the development and design of a basic web page include: information gathering, site layout and design and HTML (hyper text markup language) conversion.