- •Курсовая работа
- •Глава 1
- •Глава 2
- •2.1.1 Матрицы
- •2.1.2 Определители.
- •2.2.1. Функциональные требования
- •2.2.2. Требования к интерфейсу
- •Глава 3
- •3.2.1.Классы
- •3.2.2.Модули
- •3.2.3.Схема алгоритма
- •3.2.4.Обработка исключений
- •Исходный текст программы Project1.Cpp
- •Unit1.H
- •Unit1.Cpp
- •File1.Cpp
- •Unit2.H
- •Unit2.Cpp
- •File2.H
Unit1.Cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
#include "Unit4.h"
#include "File2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
_Mat1.InitZero();
_Mat2.InitZero();
_SG1_R = 3;
_SG1_C = 3;
_SG2_R = 3;
_SG2_C = 3;
_SGFocus = StringGrid1;
_MatFocus = &_Mat1;
_Memory = 0;
_SGFocusInt = 1;
for (int i = 1; i <= SGMAX; i++)
{
StringGrid1->Cells[i][0] = IntToStr(i);
StringGrid2->Cells[i][0] = IntToStr(i);
StringGrid3->Cells[i][0] = IntToStr(i);
}
for (int i = 1; i <= SGMAX; i++)
{
StringGrid1->Cells[0][i] = IntToStr(i);
StringGrid2->Cells[0][i] = IntToStr(i);
StringGrid3->Cells[0][i] = IntToStr(i);
}
for (int i = 1; i < SGMAX ; i++)
for (int j = 1; j < SGMAX; j++)
{
StringGrid1->Cells[j][i] = "0";
StringGrid2->Cells[j][i] = "0";
StringGrid3->Cells[j][i] = "0";
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void __fastcall TForm1::Button6Click(TObject *Sender)
{
try
{
ReadForm();
_Res.MSumm(_Mat1, _Mat2);
WriteForm();
}
catch (int ExceptCode)
{
ExceptCatch(ExceptCode);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)
{
try
{
ReadForm();
_Res.MMult(_Mat1, _Mat2);
WriteForm();
}
catch (int ErrCode)
{
ExceptCatch(ErrCode);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button7Click(TObject *Sender)
{
try
{
ReadForm();
_Res.MDiff(_Mat1, _Mat2);
WriteForm();
}
catch (int ErrCode)
{
ExceptCatch(ErrCode);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3_1Click(TObject *Sender)
{
StringGrid1->RowCount = StringGrid3->RowCount;
StringGrid1->ColCount = StringGrid3->ColCount;
Edit1_1->Text = IntToStr(_SG1_R = StringGrid1->RowCount - 1);
Edit1_2->Text = IntToStr(_SG1_C = StringGrid1->ColCount - 1);
_Mat1 = _Res;
Print(1);
}
............................................
И т.д.