#include <vcl.h>
#pragma hdrstop
#include "Unit03.h"
#pragma package(smart_init)
#pragma resource "*.dfm"

TForm1 *Form1;

struct Student       // deklaracja ogólnego typu struktury Student
  {
   char Imie[20];
   char Nazwisko[20];
   float EgzaminMatematyka;
   float EgzaminFizyka;
   float EgzaminInformatyka;
   char JakiStudent[30];
  };

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
   Label1->Caption = "Imię";
   Label2->Caption = "Nazwisko";
   Label3->Caption = "Ocena z fizyki";
   Label4->Caption = "Ocena z matematyki";
   Label5->Caption = "Ocena z informatyki";
   Label6->Caption = "Opinia";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{

  static struct Student
  Student1 = {"Wacek", "Jankowski", 5, 5, 5, "bardzo dobry student"};
  static struct Student
  Student2 = {"Janek", "Wackowski", 2.5, 2.5, 2.5, "kiepski student"};

  Edit1->Text = Student1.Imie;
  Edit2->Text = Student1.Nazwisko;
  Edit3->Text = Student1.EgzaminFizyka;
  Edit4->Text = Student1.EgzaminMatematyka;
  Edit5->Text = Student1.EgzaminInformatyka;
  Edit6->Text = Student1.JakiStudent;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
    Application->Terminate();
}
//---------------------------------------------------------------------------

