You are Here: Home

# Pascal programming watch

1. Does anyone know how to programme in Pascal ... it is what i am using for my Computing coursework - The Villiage Hall, Unit 3.

I have hardly started i am getting worried now i want to programme but i done no how to fix this as it does not give me the correct day:

program newannascalculator;

var counter, dayfinal :integer;
k, D, C,m, month1 :integer;
day, day1, day2, day3, day4, day5 :integer;
dayofweek : array [0..6] of String;
month : array [1..12] of String;

//f = k + [(13*m-1)/5] + D + [D/4] + [C/4] - 2*C.

begin
dayofweek[0] := 'Sunday';
dayofweek[1] := 'Monday';
dayofweek[2] := 'Tuesday';
dayofweek[3] := 'Wednesday';
dayofweek[4] := 'Thursday';
dayofweek[5] := 'Friday';
dayofweek[6] := 'Saturday';

month[1]:= 'march';
month[2]:= 'april';
month[3]:= 'may';
month[4]:= 'june';
month[5]:= 'july';
month[6]:= 'august';
month[7]:= 'september';
month[8]:= 'october';
month[9]:= 'november' ;
month[10]:= 'december';
month[11]:= 'january' ;
month[12]:= 'february';

writeln('Enter the chosen date of the month.');
while (k < 1) or (k > 31) do
begin
writeln ('Wrong!!!');
end;
writeln('Enter the chosen month.(as a digit)') ;

writeln('Enter the first two digits chosen year.') ;

writeln('Enter the last two digits of the chosen year.');

counter :=0;

//f = k + [(13*m-1)/5] + D + [D/4] + [C/4] - 2*C.

if m - 1 = 0 then m:= 12 else m := m-1 ;

day := (13*(m))div 5;
writeln (day);

day1 :=k + day ;
writeln (day1);

day2 := day1 + D;
writeln (day2);

day3 := day2 + D div 4;
writeln (day3);

day4 := day3 + C div 4 ;
writeln (day4);
day5 := day4 - 2*C;
writeln (day5);

writeln (day5 div 7);

dayfinal := day5 mod 7;
writeln (dayfinal);
//f - 7*[f/7]
if dayfinal <0
then dayfinal := dayfinal-7*(dayfinal div 7) ;
writeln (dayfinal);
// repeat
//dayofweek :=dayfinal + dayofweek[counter];
writeln (dayofweek[dayfinal]);
//counter :=counter+1;
//until counter=dayfinal;

end.

Thanks
2. you should post this in the Dev subforum in the Technology forum, youde get a lot more replies and help there from experienced programmers.

Wiz

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: April 13, 2006
Today on TSR

### Summer Bucket List is Back!

Start yours and you could win £150!

### Why are girls so attracted to tall guys?

Poll
Useful resources

Can you help? Study Help unanswered threadsStudy Help rules and posting guidelines

## Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE