Darmowe Forum

Turbo Pascal => Podstawy Turbo Pascal => Wątek zaczęty przez: admin Maj 16, 2011, 09:31:24



Tytuł: Powtorzenie - na życzenie,
Wiadomość wysłana przez: admin Maj 16, 2011, 09:31:24
Zadanie 1 . Napisać program który sprawdzi poprawność wprowadzonego z klawiatury numeru PESEL.

program pesel;
uses crt,dos;
var pes: string;
i:integer;
begin textcolor(white);clrscr;
gotoxy(10,10); write('PODAJ PESEL:');readln(pes);
i:=length(pes);
if i<>11 then
begin clrscr;gotoxy(10,10); textcolor(red); write('BLAD !!!!');
end;

readkey;

end.


Tytuł: Odp: Powtorzenie - na życzenie,
Wiadomość wysłana przez: admin Maj 16, 2011, 10:34:30
program pesel;
uses crt,dos;
var pes: string;
i,z:integer;
begin textcolor(white);clrscr;
gotoxy(10,10); write('PODAJ PESEL:');readln(pes);
i:=length(pes);
 for z:=1 to i do begin
 if (ord(pes[z])>=48) and (ord(pes[z])<58) then begin end
 else begin write('X');end;

   end;

if i<>11 then
begin clrscr;gotoxy(10,10); textcolor(red); write('BLAD !!!!');
end;

readkey;

end.


Tytuł: Odp: Powtorzenie - na życzenie,
Wiadomość wysłana przez: admin Maj 16, 2011, 11:38:42
program pesel;
uses crt,dos;
var pes: string;
i,x:integer;
begin textcolor(white);clrscr;
gotoxy(10,10); write('PODAJ PESEL:');readln(pes);
i:=length(pes);
for x:=1 to i do
begin

end;

if ((pes[3]='1') and ((pes[4]='0') or (pes[4]='1') or (pes[4]='2'))) then


begin end else

if (pes[3]='0') and  ((ord(pes[4])>=49) and  (ord(pes[4])<58)) then

begin end else
begin writeln('Blad miesiaca'); end;






if i<>11 then
begin clrscr;gotoxy(10,10); textcolor(red); write('BLAD !!!!');
end;

readkey;

end.


Tytuł: Odp: Powtorzenie - na życzenie,
Wiadomość wysłana przez: admin Maj 23, 2011, 07:05:19
Zadanie 5. Program klasowkowy

program bimbacz;
uses crt,dos;
type
motocykl = record
marka :string[10];
symbol :string[10];
predkoscmax :integer;
end;
var
garaz :array[1..4] of motocykl;
a :integer;
begin
writeln('Jakie 4  motocykle kupujesz?

');
for a:=1 to 4 do
begin
writeln('Marka motocykla nr: ',a,' to: ');
readln(garaz[a].marka);
writeln('Symbol motocykla nr: ',a,' to: ');
readln(garaz[a].symbol);
writeln('Najszybciej jechales motocyklem nr:

',a,'[km/h] ? ');
readln(garaz[a].predkoscmax);
end;
writeln('Wyswietle co jest w garazu wcisnij

ENTER');
readln;
for a:=1 to 4 do
begin
writeln('motorek nr: ',a);
writeln(garaz[a].marka);
writeln(garaz[a].symbol);
writeln(garaz[a].predkoscmax);
end;

write('ktory motor chcesz wyswietlic: ');
readln(a);
writeln('motorek nr: ',a);
writeln(garaz[a].marka);
writeln(garaz[a].symbol);
writeln(garaz[a].predkoscmax);   
writeln('KONIEC wcisnij ENTER');
readkey;
end.


Polityka cookies
Darmowe Fora | Darmowe Forum

aplikacja2013 polskiserwerfreeplay puppy-years bezludna-wyspa unihokej