Individual ASSIGNMENT
Table of content Topics | Page | i) Table of Content ii) Pascal Program a. Source Code b. Sample Input/output c. Project Compilation Status | 12-5 |
program individualAssignment;Uses Crt , sysutils;const strState : array[1..2] of string = ('Selangor','Johor'); strMonth : array[1..6] of string = ('January','February','March','April','May','June');type rainfallRec = record state , city : String; amountRain : array[1..6] of Integer; end;procedure getRainfall(var rainfall : array of rainfallRec);var i,j : integer; intState : Integer;begin for i := 1 to 6 do begin write('Enter district: '); readln(rainfall[i].city); writeln('Select state :'); writeln('1) Selangor'); writeln('2) Johor'); readln(intState); rainfall[i].state := strState[intState]; for j := 1 to 6 do begin write('Enter rainfall for ' + strMonth[j] + ' :'); readln(rainfall[i].amountRain[j]); end; clrscr; end;end;function countRainAmountExceedTenK(rainfall :array of rainfallRec) : integer;var i, count : Integer;begin count := 0; writeln('rainfall more than 100, 000 liter in the month of March'); for i:= 1 to 6 do begin if (rainfall[i].amountRain[3] > 100000) then begin writeln('City : ' + rainfall[i].city); writeln('State : ' + rainfall[i].state); count := count + 1; end; end; countRainAmountExceedTenK :=