4 שיעור  
					  
SCALAR -- integer, real, boolean, char
          ordinal   subrange     enumerated:ord, pred, succ
CONST

type days=(sunday, monday, tuesday, wednesday, thursday, friday, saturday);
var YOM:days;
    today, tom, yest:days;
  today:=tuesday;        tuesday:=3;
  tom:=succ(today);      tom:=today+1;
  if today=saturday then tom:=sunday
                    else tom:=succ(today);

type letters=('a','b','c','d','e','f');    /* illegal */

type godel=(small, medium, large, xlarge);
var shirt:godel;
    day:(sunday, monday, tuesday, wednesday, thursday, friday, saturday);
    color:(red, yellow, blue);
ord(sunday)
if today=sunday then writeln('SUNDAY')
  else if today=monday then writeln('MONDAY')
    else if today=tuesday then writeln('TUESDAY')
      else if today=wednesday then writeln('WEDNESDAY')
        else if today=thursday then writeln('THURSDAY')
          else if today=friday then writeln('FRIDAY')
            else if today=saturday then writeln('SATURDAY');

case today of
  sunday:writeln('SUNDAY');
  monday:writeln('MONDAY');
  tuesday:writeln('TUESDAY');
  wednesday:writeln('WEDNESDAY');
  thursday:writeln('THURSDAY');
  friday:writeln('FRIDAY');
  saturday:writeln('SATURDAY')
end;
case today of
  sunday,monday,wednesday,thursday:begin
                                     ....
                                   end;
  friday,saturday:begin
                    ...
                  end;
  else begin
         ...
       end
end;

type letters='a'..'z';
     days=(sunday, monday, tuesday, wednesday, thursday, friday, saturday);
var numdays:29..30;
    digit:'0'..'9';
    weekday:sunday..thursday;
    initial:letters;


---------------------------------------------------------------------------

var a:array[1..10] of real;
    b:array[1..10] of integer;
    c:array[1..10] of char;
    d:array[char] of integer;

a[5]:=3.5;  b[3]:=7;  c[7]:='a';  d['a']:=7;

const mispmif=30;
var KOLOT:array[1..mispmif] of integer;
    i:integer;

for i:=1 to mispmif do  kolot[i]:=0;
while not eof do
begin
  readln(i);
  if i in [1..30] then kolot[i]:=kolot[i]+1
                  else writeln('Please enter valid number [1..30]: ')
end;
var total,rov:integer;
    mehapes:boolean;

total:=0;
for i:=1 to mispmif do  total:=total+kolot[i];
rov:=total div 2 + 1;
i:=1;  mehapes:=true;
while mehapes and (i <= mispmif) do
  if kolot[i] >= rov
    then mehapes:=false
    else i:=i+1;
if mehapes then writeln('No party received a clear majority.')
           else writeln('Party number ',i,' received a clear majority.');

type MIFLAGOT=(maarach, likud, ......  ,ratz);
var KOLOT:array[miflagot] of integer;
    miflaga:miflagot;
for miflaga:=maarach to ratz do
  kolot[miflaga]:=0;