Разработка программы обработки массива данных с построением диаграммы (предметная область-«Меню»)

Автор работы: Пользователь скрыл имя, 11 Марта 2013 в 21:13, курсовая работа

Описание работы

Система программирования Turbo Pascal, разработанная американской корпорацией Borland, является одной из самых популярных систем программирования в мире. Пакет Borland Pascal 7.0 учитывает многие новейшие достижения в программировании и практике создания программ( в том числе программ обработки статистических данных) и включает в себя три режима работы: в обычном режиме операционной системы MS DOS, в защищенном режиме MS DOS и в среде Windows. Обладая расширенными возможностями, пакет Borland Pascal 7.0 тем не менее требует для использования всех своих возможностей довольно большую память – примерно 30 Мбайт на жестком диске и не менее 2 Мбайт оперативной памяти.

Содержание работы

Министерство образования РФ 1
Введение 5
1 Постановка задачи на разработку программы 6
2 Состав и структура исходных данных и результатов 7
3 Методы решения задач 9
4 Описание программы 11
5 Методика отладки программы 12
6 Руководство пользователя 15
Заключение 19
Литература 20
ПРИЛОЖЕНИЕ A. Схема программы 30
ПРИЛОЖЕНИЕ Б. Текст программы 33
ПРИЛОЖЕНИЕ В. Результаты работы программы 43

Файлы: 1 файл

Kursovoi.doc

— 606.50 Кб (Скачать файл)

 

 

Writeln('            ╔═════════════════════════════════════════╗');          

writeln('             ║    Нажмите Enter для перехода в Меню                                             ║');          

Writeln('            ╚═════════════════════════════════════════╝');          

end;                                                                         

end;                                                                         

end;                                                                         

                                                                             

Procedure Sortirovka;   {сортиоровка обменом}                                

Var d,i:integer;                                                             

Var d,i:integer;                                                             

z:zap;                                                                       

begin                                                                        

if n>0 then                                                                  

begin                                                                        

repeat                                                                       

d:=0;                                                                        

for i:=1 to n-1 do                                                           

begin                                                                        

if m[i].cena>m[i+1].cena then                                                

begin                                                                        

d:=1;                                                                        

z:=m[i+1];                                                                   

m[i+1]:=m[i];                                                                

m[i]:=z;                                                                     

end;                                                                         

end;                                                                         

until d=0;                                                                   

writeln('Данные  отсортированы по цене в порядке  возрастания');               

end                                                                          

else writeln('Список  не содержит записей');                                  

writeln('Нажмите любую клавишу для перехода в меню.');                       

readkey                                                                      

end;                                                                         

                                                                             

 

 

Procedure Diagramma;                                                         

const                                                                        

colorG=7;                                                                    

var                                                                          

sum:real;                                                                    

gd,gm,l,k,i,x,y,r:integer;                                                   

a,b:real;                                                                    

ss:string;                                                                   

begin                                                                        

x:=250; y:=150; r:=120;                                                      

DetectGraph(gd,gm);                                                          

InitGraph(gd,gm,'');                                                         

SetColor(colorG);     {выбор цвета}                                          

Circle(x,y,R);       {окружность}                                            

sum:=0;                                                                      

a:=0;                                                                        

for i:=1 to n do                                                             

begin                                                                        

SetFillStyle(SolidFill,i);                                                   

RectAngle(R, 5*R div 2+i*25, R+20, 5*R div 2+i*25+20);                       

FloodFill(R+2, 5*R div 2+i*25+3,colorG);                                     

OutTextXY(R+30, 5*R div 2+i*25+5, M[i].nazv);                                

end;                                                                         

for i:=1 to n do                                                             

sum:=sum+M[i].cena;                                                          

for i:=1 to n do                                                             

begin                                                                        

a:=a+2*Pi*M[i].cena/sum;                                                     

Line(x,y,x+round(R*cos(a)),y+round(R*sin(a)));                               

end;                                                                         

a:=0; b:=0; i:=0;                                                            

for i:=1 to n do                                                             

begin                                                                        

SetFillStyle(SolidFill,i);                                                   

b:=a;                                                                        

a:=a+2*Pi*M[i].cena/sum;                                                     

l:=(2*x+round(R*cos(a-(a-b)/2)))div 2;                                       

k:=(2*y+round(R*sin(a-(a-b)/2)))div 2;                                       

FloodFill(l,k,colorG);                                                       

str(M[i].cena:5:2,ss);                                                       

OutTextXY(l,k,ss);                                                           

end;                                                                         

OutText('Для выхода нажмите Enter');                                         

readln;                                                                      

closegraph;                                                                  

Textattr:=16*0+11;                                                           

Writeln('');                                                                 

Writeln('                ╔═════════════════════════════════════════╗');      

writeln('                 ║    Нажмите Enter для перехода в Меню                                             ║');      

Writeln('                ╚═════════════════════════════════════════╝');      

end;                                                                         

                                                                             

Procedure Vihod;                                                             

begin                                                                        

Exit;                                                                        

end;                                                                         

                                                                             

 

 

BEGIN                                                                        

clrscr;                                                                      

textattr:=16*0+15;                                                           

writeln('╔══════════════════════════════════════════════════╗');      

writeln('║           Курсовая работа по информатике и программированию                                ║');      

writeln('║                                                                                                                                           ║');      

writeln('║                       Программа "Меню"                                                                                   ║');           

writeln('║         Программу разработал ст.гр. 10Эб Гусакова Татьяна Олеговна                        ║');        

writeln('║                                                                                                                                            ║');      

writeln('╚═════════=════════════════════════════════════════╝');      

end;                                                                         

writeln;                                                                     

Textattr:=16*0+11;                                                           

repeat                                                                       

Writeln('            ╔═════════════════════════════════════════╗');          

writeln('             ║    Нажмите Enter для перехода в Меню                                             ║');          

Writeln('            ╚═════════════════════════════════════════╝');          

readln;                                                                      

clrscr;                                                                      

textattr:=16*0+15;                                                           

writeln('╔════════════=═══════════════════╗');       

writeln('║                         Меню                                                     ║');       

writeln('╠═══════╦═══════╦═══════╦════════╣');       

writeln('║ 1. Ввод      ║ 2. Вывод   ║ 3.Запись в ║ 4.Чтение из  ║');       

writeln('║    данных  ║    данных  ║    файл       ║   файла          ║');       

writeln('╚═══════╩═══════╩═══════╩=═════==═╝');       

writeln('╔═════════╦════════╦═══════╦════════════=═╗');       

writeln('║ 5.Дополнениe║ 6.Удаление ║ 7.Поиск     ║ 8.Сортировка                ║');       

writeln('║   данных         ║   данных     ║   данных    ║   данных                       ║');       

writeln('╚═════════╩══=═════╩═══════╩══════════════╝');       

writeln('╔════════════════╦════════════════════════╗');       

writeln('║    9.Диаграмма данных   ║   10.Выход из программы                      ║');       

writeln('║                                            ║                                                                  ║');       

writeln('╚════════════════╩════════════════════════╝');       

                                                                                                                                                 

writeln('Введите  пункт Меню: ');                                             

readln(PM);                                                                  

case PM of                                                                   

1: begin                                                                     

writeln('1.Заполнение  таблицы данными');                                     

Vvod;                                                                        

end;                                                                         

2: begin                                                                     

writeln('2.Вывод данных');                                                   

Vivod;                                                                       

end;                                                                         

Информация о работе Разработка программы обработки массива данных с построением диаграммы (предметная область-«Меню»)