Development of custom software

Using C ++ Builder to create a binary file. The development of a dynamic array structure of the binary data using the individual functions, located in the library user. The general analysis of the data. Create screensaver with information about the task.

Рубрика Программирование, компьютеры и кибернетика
Вид курсовая работа
Язык английский
Дата добавления 13.07.2014
Размер файла 2,1 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

Размещено на http://allbest.ru

Размещено на http://allbest.ru

Individual task

array user dynamic binary

1. Using C++ Builder create a binary file. Write to the file structure with the fields specified in the task.

2. List contents of this file in a component StringGrid.

3. Create a dynamic array of structures of the binary data. Determination of the number of elements in the array and its formation should be implemented in separate functions, located in the library and created by the user.

4. Perform tasks specified in the table of tasks (3 tasks) using the functions defined in the user library.

5. Create a splash-screen, information about the task and the author

Assignment for the Course Work

Structure fields

Set

Collation

Text file

20

No. of Flight

Departure

Arrival

Direction

Airplane Brand

Distance

Display data on flight with a maximum duration of the flight

No. of flight descending order

Information on flights departure before 12:00.

1.Theoretical part

Files

A computer file is a resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished. A file is a named area of external/auxiliary memory for program & data storage.

Each file has following properties: name, size, date of last saving, place on the disk, access attributes.

Names of files consist of name, dot & expansion. Name is a set alphabet symbols, numbers and special symbols. Expansion determines type of file and contains usually 3 symbols.

In this work we're going to operate with two types of files: binary and text. A binary file is any file stored on a computer or related media. Any and all computer data is stored in binary form -- that is, it consists of ones and zeros. Computer files that have only textual information are simpler than other files, such as those that store images, for instance. Therefore, a distinction is often made between text files and all other file types, and the term "binary file" typically refers to the latter.

Computer data is often broken up into characters, and each is called a byte of information. The word “Hi” is broken up into two characters -- “H” and “i” -- which can be represented as numbers 72 and 105. These numbers are then stored in a computer file in binary form as 01001000 and 01101001.

Text files may contain textual characters such as H, i, period, space, symbols, as well as information such as tab placement and start of a new line. Formatting information can be coded in a text file, for example, <b> indicates bold in web page HTML files. Computers manipulate data beyond this, however, and data could be normal numbers, big scientific numbers, images, sounds, videos, program instructions, etc. Such data cannot be stored efficiently in text files, and is stored in binary instead.

Functions

Function is a concrete part of the program to which it is possible to address from other parts of the program so many time, how many it is required. Let's consider the program printing levels of number 2:

extern float pow (float, int); // pow () is defined in other place

main ()

{

for (int i=0; i &lt;10; i ++) cout &lt;<pow (2,="" i)="" «"\n";<br=""><!--10-->}

The first line of function - the description specifying that pow - the function receiving float and int parameters and returning float. The description of function is used to make certain appeals to function in other places.

By a call the type of each function parameter is compared with expected type in the same way as though the variable of the described type was initialized. It guarantees appropriate check and type conversion. For example, pow address (12.3, "abcd") will displease the compiler as "abcd" is line, instead of int. By pow call (2, i) the compiler will transform 2 to the float type as that is required by function. The pow function can be defined for example so:

float pow (float x, int n)

{if (n &lt;0) error ("excuse, the negative index for pow ()");

<!--0-->switch (n) {

case 0: return 1;

case 1: return x;

default: return x*pow (x, n-1);}}

The first part of determination of function sets function name, type of value returned by it (if that is available) both types and names of its parameters (if they are). Value returns from function by means of the operator of return.

Different functions usually have different names, but to the functions executing similar actions over objects of different types, it is sometimes better to give the chance to have identical names. If types of their parameters are various, the compiler can always distinguish them and select the necessary function for a call. Perhaps for example, to be available one function of exponentiation for the whole variables and another for variables with a floating point:

overload pow;

int pow (int, int);

double pow (double, double);

x=pow(2,10);

y=pow(2.0,10.0);

Description

overload pow;

reports to the compiler that name pow use more than for one function is deliberate.

If function doesn't return value, it should be described as void:

void swap (int * p, int * q)//to trade places

{int t = * p;

* p = * q;

* q = t;

}</pow>

Pointers

The memory of your computer can be imagined as a succession of memory cells, each one of the minimal size that computers manage (one byte). These single-byte memory cells are numbered in a consecutive way, so as, within any block of memory, every cell has the same number as the previous one plus one. This way, each cell can be easily located in the memory because it has a unique address and all the memory cells follow a successive pattern. For example, if we are looking for cell 1776 we know that it is going to be right between cells 1775 and 1777, exactly one thousand cells after 776 and exactly one thousand cells before cell 2776.

Due to the ability of a pointer to directly refer to the value that it points to, it becomes necessary to specify in its declaration which data type a pointer is going to point to. It is not the same thing to point to a char as to point to an int or a float. The declaration of pointers follows this format:

type * name;

where type is the data type of the value that the pointer is intended to point to. This type is not the type of the pointer itself! but the type of the data the pointer points to. For example:

1
2
3

int * number;

char * character;

float * greatnumber;

These are three declarations of pointers. Each one is intended to point to a different data type, but in fact all of them are pointers and all of them will occupy the same amount of space in memory (the size in memory of a pointer depends on the platform where the code is going to run). Nevertheless, the data to which they point to do not occupy the same amount of space nor are of the same type: the first one points to an int, the second one to achar and the last one to a float. Therefore, although these three example variables are all of them pointers which occupy the same size in memory, they are said to have different types: int*, char* and float* respectively, depending on the type they point to.

Dynamic memory

In order to request dynamic memory we use the operator new. new is followed by a data type specifier and -if a sequence of more than one element is required- the number of these within brackets []. It returns a pointer to the beginning of the new block of memory allocated. Its form is:

pointer = new type

pointer = new type [number_of_elements]

The first expression is used to allocate memory to contain one single element of type type. The second one is used to assign a block (an array) of elements of type type, where number_of_elements is an integer value representing the amount of these.

For example:

1
2

int * bobby;

bobby = new int [5];

In this case, the system dynamically assigns space for five elements of type int and returns a pointer to the first element of the sequence, which is assigned to bobby. Therefore, now, bobby points to a valid block of memory with space for five elements of type int.

The first element pointed by bobby can be accessed either with the expression bobby[0] or the expression *bobby. Both are equivalent as has been explained in the section about pointers. The second element can be accessed either with bobby[1] or *(bobby+1) and so on...

Since the necessity of dynamic memory is usually limited to specific moments within a program, once it is no longer needed it should be freed so that the memory becomes available again for other requests of dynamic memory. This is the purpose of the operator delete, whose format is:

1
2

delete pointer;

delete [] pointer;

The first expression should be used to delete memory allocated for a single element, and the second one for memory allocated for arrays of elements.

Structures

A data structure is a group of data elements grouped together under one name. These data elements, known asmembers, can have different types and different lengths. Data structures are declared in C++ using the following syntax:

struct structure_name {

member_type1 member_name1;

member_type2 member_name2;

The Program code

Unit1.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit1.h"

#include "lib.h"

#include "Unit2.h"

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm1 *Form1;

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)

{//properties of components on form

Label8->Visible=false; Label8->Top=100; Label8->Left=430;

Label9->Visible=false; Label9->Top=125; Label9->Left=280;

Image1->Visible=true; Image2->Visible=false;

GroupBox1->Visible=false; GroupBox1->Top=137; GroupBox1->Left=316;

SG2->Top=244; SG2->Left=200;

SG1->Top=144; SG1->Left=160;

Memo1->Top=136; Memo1->Left=255; Memo1->Visible=false;

Label1->Caption="Add new item";

SG1->Visible=false; SG2->Visible=false;

if ((fb=fopen("planes.dat","rb"))==0) //if binary file does not exist

{Textfile1->Enabled=false; // you are not allowed to

Sort1->Enabled=false; //sort

Task11->Enabled=false; //watch the flight with maximum time of flight

Correct1->Enabled=false; //correct

Delete1->Enabled=false;}} //and delete items

//---------------------------------------------------------------------------

//function of outputting structure into StringGrid

void setka(TStringGrid *sg, plane d,int N)

{sg->Cells[0][N]=IntToStr(N);

sg->Cells[1][N]=IntToStr(pl.F);

sg->Cells[2][N]=(String)pl.Dir;

sg->Cells[3][N]=(String)pl.Dt;

sg->Cells[4][N]=(String)pl.At;

sg->Cells[5][N]=FloatToStr(pl.Dis);

sg->Cells[6][N]=(String)pl.Br;}

// function of filling fixed row into StringGrid

void setka2(TStringGrid *sg)

{sg->Cells[0][0]="№";

sg->Cells[1][0]="№";

sg->Cells[2][0]="Direction";

sg->Cells[3][0]="Departure";

sg->Cells[4][0]="Arrival";

sg->Cells[5][0]="Distance";

sg->Cells[6][0]="Brand";}

int flag, n;

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (flag==0) //flag=0 - writing to the end of file

{pl.F=StrToInt(Edit1->Text);

strcpy(pl.Dir,Edit2->Text.c_str());

strcpy(pl.Dt,Edit3->Text.c_str());

strcpy(pl.At,Edit4->Text.c_str());

pl.Dis=StrToInt(Edit5->Text);

strcpy(pl.Br,Edit6->Text.c_str());

fb=fopen(pb,"ab");

fwrite(&pl,sizeof(plane),1,fb);

fclose(fb);}

else //flag=1 - correcting of file

{if ((fb=fopen(pb,"rb+"))==NULL) {ShowMessage("No file"); return;}

pl.F=StrToInt(Edit1->Text);

strcpy(pl.Dir,Edit2->Text.c_str());

strcpy(pl.Dt,Edit3->Text.c_str());

strcpy(pl.At,Edit4->Text.c_str());

pl.Dis=StrToInt(Edit5->Text);

strcpy(pl.Br,Edit6->Text.c_str());

fseek(fb,(n-1)*sizeof(plane),0);

fwrite(&pl,sizeof(plane),1,fb);

fseek(fb,0,0);

int i=2;

while (fread(&pl,sizeof(plane),1,fb))

{SG1->RowCount=i;

SG1->Cells[0][i-1]=IntToStr(pl.F);

SG1->Cells[1][i-1]=AnsiString(pl.Dir);

SG1->Cells[2][i-1]=AnsiString(pl.Dt);

SG1->Cells[3][i-1]=AnsiString(pl.At);

SG1->Cells[4][i-1]=IntToStr(pl.Dis);

SG1->Cells[5][i-1]=AnsiString(pl.Br);

i++;}

fclose(fb);

flag=0;}

Edit1->Clear(); Edit2->Clear(); Edit3->Clear();

Edit4->Clear(); Edit5->Clear(); Edit6->Clear();

Edit1->SetFocus();

if (Label1->Caption=="Correct chosen item")

{GroupBox1->Visible=false;

Label1->Caption="Add new item";

Memo1->Visible=false;

SG1->Visible=true;

SG2->Visible=false;}

Textfile1->Enabled=true; Sort1->Enabled=true; Task11->Enabled=true;

Correct1->Enabled=true; Delete1->Enabled=true;

Image2->Visible=true;

Label8->Visible=false; Label9->Visible=false;

Binaryfile1Click(NULL); //show corrected binary file

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Binaryfile1Click(TObject *Sender)

{

//show binary file

if ((fb=fopen(pb,"rb+"))==NULL) {ShowMessage("No file"); return;}

setka2(SG1);

fb=fopen(pb,"rb");// open file

int k=1;

while(fread(&pl,sizeof(pl),1,fb)>0 ) //read from file

{setka(SG1,pl,k); // add to StringGrid

k++;}

SG1->RowCount=k;

fclose(fb); // close binary file

GroupBox1->Visible=false;

Label1->Caption="Add new item";

Memo1->Visible=false; Image2->Visible=true;

SG1->Visible=true; SG2->Visible=false;

Textfile1->Enabled=true; Sort1->Enabled=true; Task11->Enabled=true;

Correct1->Enabled=true; Delete1->Enabled=true;

Label8->Visible=false; Label9->Visible=false;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Exit1Click(TObject *Sender)

{Close();// close the program}

//---------------------------------------------------------------------------

void __fastcall TForm1::Add1Click(TObject *Sender)

{//add window group box

GroupBox1->Visible=true; Image2->Visible=true;

Label1->Caption="Add new item";

Memo1->Visible=false;

SG1->Visible=false; SG2->Visible=false;

Label8->Visible=false; Label9->Visible=false;}

//---------------------------------------------------------------------------

void __fastcall TForm1::Correct1Click(TObject *Sender)

{

//correct

Binaryfile1Click(NULL); //show binary file

GroupBox1->Visible=false; Memo1->Visible=false;

Label1->Caption="Add new item";

SG1->Visible=true; SG2->Visible=false;

if ((fb=fopen(pb,"rb+"))==NULL) {ShowMessage("No file"); return;}

AnsiString t;

t=InputBox("What row do you want to correct?","Number of row","");

if (t=="") {ShowMessage("Please, input number of row"); return;}

n=StrToInt(t);

fseek(fb,(n-1)*sizeof(plane),0); // read chosen row and output information from it

fread(&pl,sizeof(plane),1,fb); //to edit boxes for correcting the data

Edit1->Text=IntToStr(pl.F);

Edit2->Text=AnsiString(pl.Dir);

Edit3->Text=AnsiString(pl.Dt);

Edit4->Text=AnsiString(pl.At);

Edit5->Text=IntToStr(pl.Dis);

Edit6->Text=AnsiString(pl.Br);

fclose(fb); // close binary file

flag=1; // correcting of file

GroupBox1->Visible=true;

Label1->Caption="Correct chosen item";

Memo1->Visible=false; Image2->Visible=true;

SG1->Visible=false; SG2->Visible=false;

Textfile1->Enabled=true; Sort1->Enabled=true; Task11->Enabled=true;

Correct1->Enabled=true; Delete1->Enabled=true;

Label8->Visible=false; Label9->Visible=false;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Delete1Click(TObject *Sender)

{

//delete chosen item

FILE* tmp; //creating of temporal file

if ((fb=fopen(pb,"rb"))==NULL) {ShowMessage("No file"); return;}

if ((tmp=fopen("tmp.dat","wb+"))==NULL) {ShowMessage("No file"); return;}

AnsiString snom=InputBox("What row do you want to delete?","Number of row","");

if (snom=="") {ShowMessage("Please, input number of row"); return;}

int kk, k=StrToInt(snom);

while ((fread(&pl,sizeof(plane),1,fb))) // read data from binary file

{kk=ftell(fb)/sizeof(plane);

if (k==kk) continue; //except chosen row

fwrite(&pl,sizeof(plane),1,tmp);} //writing it to the temporal file

fclose(fb);

fseek(tmp,0,0);

fb=fopen(pb,"wb+");

while ((fread(&pl,sizeof(plane),1,tmp))) // rewriting data from temporal file to binary file

fwrite(&pl,sizeof(plane),1,fb);

fclose(tmp); // close temporal binary file

fclose(fb); // close binary file

remove("tmp.dat"); // deleting of temporal file

Binaryfile1Click(NULL); //show corrected binary file

GroupBox1->Visible=false;

Label1->Caption="Add new item";

Memo1->Visible=false; Image2->Visible=true;

SG1->Visible=true; SG2->Visible=false;

Textfile1->Enabled=true; Sort1->Enabled=true; Task11->Enabled=true;

Correct1->Enabled=true; Delete1->Enabled=true;

Label8->Visible=false; Label9->Visible=false;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Task11Click(TObject *Sender)

{

//Display data on flight with a maximum duration of the flight

int k=0, i=0;

if ((fb=fopen("planes.dat","rb"))==0) {ShowMessage("No file"); return;}

while (fread(&pl,sizeof(plane),1,fb))

{k++;} // count quantity of items in file

fseek(fb,0,0);

plane *mas=new plane[k]; // creating of dynamic array

formir(fb,mas,i); //adding all structures to dynamic array

if ((fb=fopen(pb,"rb+"))==NULL) {ShowMessage("No file"); return;}

fb=fopen(pb,"rb");

plane max=mas[0];// first element of array = max

int ind=0;

for (i=0; i<k; i++) //looking for flight with maximum time

{if ((TTime(max.At)-TTime(max.Dt))<(TTime(mas[i].At)-TTime(mas[i].Dt)))

{max=mas[i];

ind=i;}}

setka2(SG2);

SG2->Cells[6][0]="Duration";

SG2->Cells[0][1]=IntToStr(mas[ind].F);

SG2->Cells[1][1]=(String)mas[ind].Dir;

SG2->Cells[2][1]=(String)mas[ind].Dt;

SG2->Cells[3][1]=(String)mas[ind].At;

SG2->Cells[4][1]=FloatToStr(mas[ind].Dis);

SG2->Cells[5][1]=(String)mas[ind].Br;

SG2->Cells[6][1]=(String)(TTime(mas[ind].At)-TTime(mas[ind].Dt));

fclose(fb); // close binary file

delete []mas; //deleting of dynamic array

GroupBox1->Visible=false;

Label1->Caption="Add new item";

Memo1->Visible=false; Image2->Visible=true;

SG1->Visible=false; SG2->Visible=true;

Textfile1->Enabled=true; Sort1->Enabled=true; Task11->Enabled=true;

Correct1->Enabled=true; Delete1->Enabled=true;

Label8->Visible=false; Label9->Visible=true;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Sort1Click(TObject *Sender)

{

// No. of flight descending

Label8->Visible=false;

Label9->Visible=false;

int k=0, i=0, j;

if ((fb=fopen("planes.dat","rb"))==0) {ShowMessage("No file"); return;}

while (fread(&pl,sizeof(plane),1,fb))

{k++;} // count quantity of items in file

fseek(fb,0,0);

plane *mas=new plane[k]; // creating of dynamic array

formir(fb,mas,i); //adding all structures to dynamic array

sort(mas,k); //sorting of array descending

if ((fb=fopen("planes.dat","wb"))==0) {ShowMessage("No file"); return;}

for (i=0; i<k; i++) //saving sorted array to binary file

{fwrite(&mas[i],sizeof(plane),1,fb);}

fclose(fb); // close binary file

Binaryfile1Click(NULL); //show binary file with changes

delete []mas; //deleting of dynamic array

GroupBox1->Visible=false; Memo1->Visible=false;

Label1->Caption="Add new item";

SG1->Visible=true; SG2->Visible=false;

Textfile1->Enabled=true; Sort1->Enabled=true;

Task11->Enabled=true; Correct1->Enabled=true; Delete1->Enabled=true;

Image2->Visible=true;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Textfile1Click(TObject *Sender)

{

//Information on flights departing before 12:00.

Label8->Visible=true; Label9->Visible=false; Memo1->Clear();

ft=fopen(mt,"wt"); //open text file

fb=fopen(pb,"ab"); //open binary file

zapis(ft,fb); //call the function of writing into text file

fclose(ft); //close text file

fclose(fb); // close binary file

Memo1->Lines->LoadFromFile(mt);

GroupBox1->Visible=false;

Label1->Caption="Add new item";

Memo1->Visible=true; Image2->Visible=true;

SG1->Visible=false; SG2->Visible=false;

Textfile1->Enabled=true; Sort1->Enabled=true; Task11->Enabled=true;

Correct1->Enabled=true; Delete1->Enabled=true;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Instructions1Click(TObject *Sender)

{Form2->Show();//Show form with instructions}

//---------------------------------------------------------------------------

void __fastcall TForm1::Aboutus1Click(TObject *Sender)

{AboutBox->ShowModal();//Show AboutBox}

//---------------------------------------------------------------------------

Lib.cpp

//---------------------------------------------------------------------------

#pragma hdrstop

#include "lib.h"

#include "Unit1.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

//counting quantity of items

int kol(FILE *f1 )

{f1=fopen(pb,"rb");

fseek(f1,0,2);

int n= ftell(f1)/sizeof(plane);

fclose(f1);

return n;}

//forming of array

void formir(FILE *f1,plane mas[],int i)

{f1=fopen(pb,"rb");

while (fread(&pl,sizeof(plane),1,f1))

{mas[i]=pl;

i++;}

fclose(f1);}

//sorting of array descending

void sort(plane mas[],int k)

{int i;

bool pr;

do {

pr=true;

for (i=0; i<k-1; i++)

if (mas[i].F<mas[i+1].F)

{plane tmp=mas[i];

mas[i]=mas[i+1];

mas[i+1]=tmp;

pr=false;}}

while (!pr); }

//writing into the text file

void zapis(FILE *f1, FILE *f2)

{f2=fopen(pb,"rb");

f1=fopen(mt,"wt");

char c[5]="12:00";

while(fread(&pl,sizeof(plane),1,f2)>0 )

{if (TTime(pl.Dt)<TTime(c)) //if departing time is earlier than 12:00

fprintf(f1,"%i %s %s %s %i %s\n",pl.F,&pl.Dir,&pl.Dt,&pl.At,pl.Dis,&pl.Br);}

fclose(f1); fclose(f2);}

Lib.h

//---------------------------------------------------------------------------

#ifndef libH

#define libH

#include "stdio.h"

#include "DateUtils.hpp"

//---------------------------------------------------------------------------

FILE *ft,*fb;

/*structure with the fields

F - number

Dir[20] - direction

Dt[10] - departure time

At[10] - arrival time

Dis - distance

Br[10] - brand */

struct plane{

int F;

char Dir[20];

char Dt[10];

char At[10];

int Dis;

char Br[10]; };

plane pl;

char *pb="planes.dat";

char *mt="planes12.txt";

//prototypes of functions

void zapis(FILE *f1, FILE *f2); //writing into the text file

int kol(FILE *f1 ); //counting quantity of items

void formir(FILE *f1 ,plane mas[],int k); //forming of array

void sort(plane mas[],int i); //sorting of array descending

#endif

Unit2.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit2.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm2 *Form2;

//---------------------------------------------------------------------------

__fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner)

{}

//---------------------------------------------------------------------------

Unit2.h

//---------------------------------------------------------------------------

#ifndef Unit2H

#define Unit2H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <ComCtrls.hpp>

#include <ExtCtrls.hpp>

#include <jpeg.hpp>

//---------------------------------------------------------------------------

class TForm2 : public TForm

{__published:// IDE-managed Components

TPageControl *PageControl;

TTabSheet *Instructions;

TTabSheet *Task;

TLabel *Label1;

TImage *Image1;

TLabel *Label2;

TLabel *Label3;

TImage *Image2;

TImage *Image3;

TImage *Image4;

TLabel *Label4;

TLabel *Label5;

TLabel *Label6;

TLabel *Label7;

TLabel *Label8;

TLabel *Label9;

TLabel *Label10;

TLabel *Label11;

TLabel *Label12;

TImage *Image5;

TImage *Image6;

private:// User declarations

public:// User declarations

__fastcall TForm2(TComponent* Owner);

};

//---------------------------------------------------------------------------

extern PACKAGE TForm2 *Form2;

//---------------------------------------------------------------------------

#endif

Unit3.cpp

//---------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit3.h"

//---------------------------------------------------------------------

#pragma resource "*.dfm"

TAboutBox *AboutBox;

//---------------------------------------------------------------------

__fastcall TAboutBox::TAboutBox(TComponent* AOwner): TForm(AOwner)

{}

//---------------------------------------------------------------------

Unit3.h

//----------------------------------------------------------------------------

#ifndef Unit3H

#define Unit3H

//----------------------------------------------------------------------------

#include <vcl\System.hpp>

#include <vcl\Windows.hpp>

#include <vcl\SysUtils.hpp>

#include <vcl\Classes.hpp>

#include <vcl\Graphics.hpp>

#include <vcl\Forms.hpp>

#include <vcl\Controls.hpp>

#include <vcl\StdCtrls.hpp>

#include <vcl\Buttons.hpp>

#include <vcl\ExtCtrls.hpp>

#include <jpeg.hpp>

//----------------------------------------------------------------------------

class TAboutBox : public TForm

{__published:

TPanel *Panel1;

TImage *ProgramIcon;

TLabel *ProductName;

TButton *OKButton;

TLabel *Label1;

TLabel *Label2;

private:

public:

virtual __fastcall TAboutBox(TComponent* AOwner);

};

//----------------------------------------------------------------------------

extern PACKAGE TAboutBox *AboutBox;

//----------------------------------------------------------------------------

#endif

2.Forms

Form 1

Form 2

AboutBox

Flowcharts

3.Results

1) Set: Display data on flight with a maximum duration of the flight

2) Collation: No. of flight descending

3) Text file: Information on flights departing before 12:00.

4.Instruction for use

This program is designed for storing and processing information about the air flights. After starting the program takes the form.

To add new item in binary file you just click on Edit->Add.

If it is the first time you add the information, program will create binary file authomatically.

The form will look like this:

After typing of all information click on button “Save” on the form.

If you click on File->Binary file you will see those data added to a binary file and shown on the form in table.

If you want to correct information click on Edit->Correct.

Choose the number of row.

Then GroupBox appears on the form, where you can correct all information about flight. After clicking on button “Save” all data will be written in binary file.

If you want to delete the item from file click on Edit->Delete and type the number of raw.

For further actions it is necessary to use the tab “Operations”.

To see the information on flight with maximal duration click Operations->Maximum duration.

If you want to sort all information about flights with numbers of flights descending click Operations-> Sort descending.

To save the information on flights that departs before 12:00 in text file and look it through click Operations-> Departing before 12:00.

If you have some questions about program or author use the tab “Help”.

To complete the use of program click File->Exit.

Conclusion

Programming language C++ gives the possibility to solve a wide variety of vital problems. Elements of C++ support object-oriented programming, generic programming, provide modularity, separate compilation, exception handling, data abstraction, assigning various types or classes of objects, virtual functions.

Being creating the program for this course work one had used custom libraries and functions, different operations with structured information, dynamic data structures, some standard operations with text and binary files: as well as reading, writing, editing, deleting etc. The assigned task was executed completely.

Literature and Internet resources

1) C++.Теорія та практика: Навч. Посібник / [О.Г. Трофименко, Ю.В. Прокоп, І.Г. Швайко, Л.М. Буката та ін.] за ред. О.Г. Трофименко. - 587 с.

2) http://radio-hobby.org/modules/instruction/page.php?id=489#pagetext

3) http://cubook.supernew.org/interfece.html

4) http://samoucka.ru/document26979.html

5) http://www.heathrowairport.com/flight-information/flight-timetable

Размещено на Allbest.ru

...

Подобные документы

  • A database is a store where information is kept in an organized way. Data structures consist of pointers, strings, arrays, stacks, static and dynamic data structures. A list is a set of data items stored in some order. Methods of construction of a trees.

    топик [19,0 K], добавлен 29.06.2009

  • Data mining, developmental history of data mining and knowledge discovery. Technological elements and methods of data mining. Steps in knowledge discovery. Change and deviation detection. Related disciplines, information retrieval and text extraction.

    доклад [25,3 K], добавлен 16.06.2012

  • Web Forum - class of applications for communication site visitors. Planning of such database that to contain all information about an user is the name, last name, address, number of reports and their content, information about an user and his friends.

    отчет по практике [1,4 M], добавлен 19.03.2014

  • Проблемы оценки клиентской базы. Big Data, направления использования. Организация корпоративного хранилища данных. ER-модель для сайта оценки книг на РСУБД DB2. Облачные технологии, поддерживающие рост рынка Big Data в информационных технологиях.

    презентация [3,9 M], добавлен 17.02.2016

  • IS management standards development. The national peculiarities of the IS management standards. The most integrated existent IS management solution. General description of the ISS model. Application of semi-Markov processes in ISS state description.

    дипломная работа [2,2 M], добавлен 28.10.2011

  • Классификация задач DataMining. Создание отчетов и итогов. Возможности Data Miner в Statistica. Задача классификации, кластеризации и регрессии. Средства анализа Statistica Data Miner. Суть задачи поиск ассоциативных правил. Анализ предикторов выживания.

    курсовая работа [3,2 M], добавлен 19.05.2011

  • Построение DFD-диаграммы нулевого и первого уровня, описание их семантики. Обоснование физической организации базы данных, ее нормализация и создание таблиц в ней. Основы DML и базовый набор команд, особенности использования Create Viev Designer.

    курсовая работа [2,4 M], добавлен 25.11.2011

  • Описание функциональных возможностей технологии Data Mining как процессов обнаружения неизвестных данных. Изучение систем вывода ассоциативных правил и механизмов нейросетевых алгоритмов. Описание алгоритмов кластеризации и сфер применения Data Mining.

    контрольная работа [208,4 K], добавлен 14.06.2013

  • Классификация мобильных роботов по сферам применения. Структура мобильного робототехнического комплекса. Беспилотный военный автомобиль Guardium. Датчики робототехнических систем. Интерфейс для датчика оптокоммутатора. Открытый интерфейс iRobot Create.

    дипломная работа [4,2 M], добавлен 05.08.2010

  • Совершенствование технологий записи и хранения данных. Специфика современных требований к переработке информационных данных. Концепция шаблонов, отражающих фрагменты многоаспектных взаимоотношений в данных в основе современной технологии Data Mining.

    контрольная работа [565,6 K], добавлен 02.09.2010

  • Модули, входящие в пакет программного обеспечения. Project Menagement, Methodology Management, Portfolio Analysis, Timesheets, myPrimavera, Software Development Kit, ProjectLink. Иерархическая структура Primavera и ее взаимосвязь с программой MS Project.

    контрольная работа [9,5 K], добавлен 18.11.2009

  • The material and technological basis of the information society are all sorts of systems based on computers and computer networks, information technology, telecommunication. The task of Ukraine in area of information and communication technologies.

    реферат [29,5 K], добавлен 10.05.2011

  • Technical and economic characteristics of medical institutions. Development of an automation project. Justification of the methods of calculating cost-effectiveness. General information about health and organization safety. Providing electrical safety.

    дипломная работа [3,7 M], добавлен 14.05.2014

  • Основы для проведения кластеризации. Использование Data Mining как способа "обнаружения знаний в базах данных". Выбор алгоритмов кластеризации. Получение данных из хранилища базы данных дистанционного практикума. Кластеризация студентов и задач.

    курсовая работа [728,4 K], добавлен 10.07.2017

  • Історія виникнення комерційних додатків для комп'ютеризації повсякденних ділових операцій. Загальні відомості про сховища даних, їх основні характеристики. Класифікація сховищ інформації, компоненти їх архітектури, технології та засоби використання.

    реферат [373,9 K], добавлен 10.09.2014

  • Роль информации в мире. Теоретические основы анализа Big Data. Задачи, решаемые методами Data Mining. Выбор способа кластеризации и деления объектов на группы. Выявление однородных по местоположению точек. Построение магического квадранта провайдеров.

    дипломная работа [2,5 M], добавлен 01.07.2017

  • Определение программы управления корпоративными данными, ее цели и предпосылки внедрения. Обеспечение качества данных. Использование аналитических инструментов на базе технологий Big Data и Smart Data. Фреймворк управления корпоративными данными.

    курсовая работа [913,0 K], добавлен 24.08.2017

  • Анализ проблем, возникающих при применении методов и алгоритмов кластеризации. Основные алгоритмы разбиения на кластеры. Программа RapidMiner как среда для машинного обучения и анализа данных. Оценка качества кластеризации с помощью методов Data Mining.

    курсовая работа [3,9 M], добавлен 22.10.2012

  • Статический регулятор в системе автоматического регулирования технологическим процессом. S-модель статического регулятора в замкнутой системе автоматического управления. Окно для визуализации графиков моделируемых процессов. Вкладка general, data history.

    контрольная работа [1,2 M], добавлен 07.07.2013

  • Методика и основные этапы построения модели бизнес-процессов верхнего уровня исследуемого предприятия, его организационной структуры, классификатора. Разработка модели бизнес-процесса в IDEF0 и в нотации процедуры, применением Erwin Data Modeler.

    курсовая работа [1,6 M], добавлен 01.12.2013

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.