Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
bd_sportsmeny11.doc
Скачиваний:
4
Добавлен:
19.09.2019
Размер:
178.69 Кб
Скачать

Блок схема

Заключение

В ходе выполнения данной курсовой работы были рассмотрены

как алгоритмические так и технические проблемы реализации приложения « База данных спортсменов», изучен теоретический аспект и получен практические навыки работы текстовыми и файловыми функциями.

Получен практический опыт работы с такими возможностями языка программирования Pascal как массивы, функции, процедуры, циклы и логические операторы.

В результате выполнения данной курсовой работы были выполнены следующие задачи:

  • Изучены теоретические аспекты для реализации приложения « База данных спортсменов».

  • Разработан алгоритм работы приложения « База данных спортсменов».

  • Создан программный продукт« База данных спортсменов» на языке pascal.

  • Проведен анализ работоспособности программного продукта реализующего « База данных спортсменов».

Список литературы

  1. http://www.pascal.hop.ru/cgi-bin/index.pl?0,6

  2. http://www.ya-sam-author.com/index.php?option=com_content&view=article&id=18768%3A2009-09-03-17-32-50&catid=417%3A2010-06-01-18-13-55&Ite

  3. http://absurdopedia.net/wiki/%D0%97%D0%B0%D0%B4%D0%B0%D1%87%D0%B0_%D1%82%D1%80%D1%91%D1%85_%D1%82%D0%B5%D0%BB

  4. Таха Х. Введение в исследование операций. М.: Издательский дом “Вильямс”, 2001.–912 с.

  5. Бажин И.И. Информационные системы менеджмента. М.: ГУ-ВШЭ, 2000.- 687 с.

  6. Фаронов В.В. Turbo Pascal 7.0 Начальный курс Издательство "ОМД Групп" 2003, 577 с.

  7. Фаронов В.В. Turbo Pascal Наиболее полное руководство в подлиннике Издательство "ОМД Групп" 2003, 1054 с.

  8. Шпак Ю.А. Turbo Pascal 7.0 на примерах Издательство "Юниор", 2003, 498 с.

Приложение Листинг

uses crt, graph;

type sportsmen = record

key: string[16];{sport key}

fio: string[25];

end;

var

f: file of sportsmen;

sp:sportsmen;

arr: array[0..100] of sportsmen;

len, i:word;

s:string;

procedure drawupline;

var

h:word;

begin

write(' ');

write( chr(201) );

for h := 1 to 16 do

write( chr(205) );

write( chr(203) );

for h := 1 to 25 do

write( chr(205) );

writeln( chr(187) );

end;

procedure drawdownline;

var

h:word;

begin

write(' ');

write( chr(200) );

for h := 1 to 16 do

write( chr(205) );

write( chr(202) );

for h := 1 to 25 do

write( chr(205) );

writeln( chr(188) );

end;

procedure drawbaseline(str1,str2:string;m:byte);

var

h:word;

c1, c2:byte;

begin

if m = 17 then c1 := LightRed

else c1:= Yellow ;

write(' ');

write( chr(186) );

textcolor(c1);

write(str1);

textcolor( White );

for h := 1 to 16 - Length(str1) do

write(' ');

write( chr(186) );

textcolor(c1);

write(str2);

textcolor( White );

for h := 1 to (25 - Length(str2) ) do

write(' ' );

writeln( chr(m) );

end;

procedure menu(active, up: word; activebutton:byte);

var

index,h: word;

key:char;

begin

if activebutton >6 then activebutton := 1 ;

if activebutton <1 then activebutton := 6 ;

drawupline;

if ( up + 7 )> len then

up := len-7;

if up<1 then

up := 1;

if len <= 8 then

begin

for index := 1 to len do begin

if active = index then

drawbaseline(arr[index].key,arr[index].fio ,17)

else

drawbaseline(arr[index].key,arr[index].fio ,186);

if active<1 then active := up;

if active >len then active := len;

end;

end else

for index := up to up + 7 do begin

if active = index then

drawbaseline(arr[index].key,arr[index].fio ,17)

else

drawbaseline(arr[index].key,arr[index].fio ,186);

if active<1 then active := up;

if active >up+ 7 then active := up + 7;

end;

drawdownline;

{buttons}

writeln;

writeln;

if activebutton = 1 then textcolor(LightRed) else textcolor(White);

{button save}

write( chr(201) );

for h := 1 to 4 do

write( chr(205) );

write( chr(187) );

write(' ');

textcolor(White);

if activebutton = 2 then textcolor(LightRed) else textcolor(White);

{button del }

write( chr(201) );

for h := 1 to 4 do

write( chr(205) );

write( chr(187) );

write(' ');

textcolor(White);

if activebutton = 3 then textcolor(LightRed) else textcolor(White);

{button ADD}

write( chr(201) );

for h := 1 to 4 do

write( chr(205) );

write( chr(187) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 4 then textcolor(LightRed) else textcolor(White);

{button del all}

write( chr(201) );

for h := 1 to 7 do

write( chr(205) );

write( chr(187) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 5 then textcolor(LightRed) else textcolor(White);

{button rceate base}

write( chr(201) );

for h := 1 to 11 do

write( chr(205) );

write( chr(187) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 6 then textcolor(LightRed) else textcolor(White);

{button rceate base}

write( chr(201) );

for h := 1 to 4 do

write( chr(205) );

writeln( chr(187) );

textcolor(White);

if activebutton = 1 then textcolor(LightRed) else textcolor(White);

{buttonsave}

write(chr(186) );

write('SAVE' );

write(chr(186) );

write(' ');

textcolor(White);

if activebutton = 2 then textcolor(LightRed) else textcolor(White);

{button del}

write(chr(186) );

write('DEL ' );

write(chr(186) );

write(' ');

textcolor(White);

if activebutton = 3 then textcolor(LightRed) else textcolor(White);

{button ADD}

write(chr(186) );

write('ADD ' );

write(chr(186) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 4 then textcolor(LightRed) else textcolor(White);

{button dell}

write(chr(186) );

write('DEL All' );

write(chr(186) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 5 then textcolor(LightRed) else textcolor(White);

{button create base}

write(chr(186) );

write('CREATE BASE' );

write(chr(186) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 6 then textcolor(LightRed) else textcolor(White);

{button create base}

write(chr(186) );

write('EXIT' );

writeln(chr(186) );

textcolor(White);

if activebutton = 1 then textcolor(LightRed) else textcolor(White);

{button save}

write( chr(200) );

for h := 1 to 4 do

write( chr(205) );

write( chr(188) );

write(' ');

textcolor(White);

if activebutton = 2 then textcolor(LightRed) else textcolor(White);

{button del }

write( chr(200) );

for h := 1 to 4 do

write( chr(205) );

write( chr(188) );

write(' ');

textcolor(White);

if activebutton = 3 then textcolor(LightRed) else textcolor(White);

{button ADD}

write( chr(200) );

for h := 1 to 4 do

write( chr(205) );

write( chr(188) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 4 then textcolor(LightRed) else textcolor(White);

{button ADD}

write( chr(200) );

for h := 1 to 7 do

write( chr(205) );

write( chr(188) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 5 then textcolor(LightRed) else textcolor(White);

{button ADD}

write( chr(200) );

for h := 1 to 11 do

write( chr(205) );

write( chr(188) );

textcolor(White);

write(' ');

textcolor(White);

if activebutton = 6 then textcolor(LightRed) else textcolor(White);

{button ADD}

write( chr(200) );

for h := 1 to 4 do

write( chr(205) );

write( chr(188) );

textcolor(White);

Repeat

key:=readkey;

case ord(key) of

72:begin

clrscr;

menu(active - 1, up-1, activebutton);

end;

80: begin

clrscr;

menu(active + 1, up+1,activebutton);

end;

77: begin

clrscr;

menu(active , up, activebutton+1);

end;

75: begin

clrscr;

menu(active , up, activebutton-1);

end;

13:begin

case activebutton of

1: begin

assign(f,'base.dat');

rewrite(f);

for i:= 1 to len do

write(f, arr[i]);

close(f);

end;

2: begin

for i:=active to len do

begin

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

end;

len:=len-1;

end;

3: begin

clrscr;

write('Add type sport', chr(16),' ');

readln(sp.key);

write('Add names sportsmen ', chr(16),' ');

readln(sp.fio);

arr[len+1]:=sp;

len := len+1;

end;

4: begin

len :=0;

end;

5:begin

len:=0;

end;

6: begin halt; end;

end;

clrscr;

menu(active , up, activebutton);

end;

27:halt;

end

until key = #27;

end;

begin

clrscr;

assign(f,'base.dat');

reset(f);

i := 1;

while not eof(f) do begin

read(f,arr[i]);

inc(i);

end;

close(f);

len := i;

menu( 2, 1,1);

end.

25

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]