Написал простую программу выводящую ваш знак зодиака. Нужно еще понять как сделать что бы выводился еще и год зодиака (например год скорпиона и т.д) + если кто разбирается и сможет помочь то как ввод данных можно сдлеать через DataTimePicker. Искал информацию но ненашел понятного для себя.
Код:
unit lab12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var ch,mes:integer;
begin
ch:=strtoint(edit1.text);
mes:=strtoint(edit2.text);
if (ch>0) and (ch<32) and (mes>0) and (mes<13) then
case mes of
1:if ch>=20 then Label3.caption:=' Vodoley' else Label3.caption:=' Kozerog';
2:if ch>=20 then Label3.caption:=' Ryba' else Label3.caption:=' Vodoley';
3:if ch>=20 then Label3.caption:=' Owen' else Label3.caption:=' Ryba';
4:if ch>=20 then Label3.caption:=' Telec' else Label3.caption:=' Owen';
5:if ch>=20 then Label3.caption:=' Bliznechy' else Label3.caption:=' Telec';
6:if ch>=20 then Label3.caption:=' Rak' else Label3.caption:=' Bliznechy';
7:if ch>=20 then Label3.caption:=' Lev' else Label3.caption:=' Rak';
8:if ch>=20 then Label3.caption:=' Deva' else Label3.caption:=' Lev';
9:if ch>=20 then Label3.caption:=' Vesy' else Label3.caption:=' Deva';
10:if ch>=20 then Label3.caption:=' Skorpion' else Label3.caption:=' Vesy';
11:if ch>=20 then Label3.caption:=' Strelec' else Label3.caption:=' Skorpion';
12:if ch>=20 then Label3.caption:=' Kozerog' else Label3.caption:=' Strelec';
end
end;
end.