NAME OF LEARNER:
TOTAL QUESTION 1: TOTAL QUESTION 2: TOTAL QUESTION 3: TOTAL QUESTION 4: TOTAL
/40 /40 /38 /32 /150

MEMORANDUM

QUESTION 1: GENERAL PROGRAMMING SKILLS MAX. MARKS MARKS ACHIEVED
1.1

Button [1.1]

  • Load image to image file
  • Enable pnlBath
  • Colour of pnlRain changed to aqua
3  
1.2

Button [1.2 Process]

  • Get rain input from cmbRain or use the itemindex
  • Extract the amount of millimetres:
  • Check rain input for ‘/'
  • ’If no ‘/’ in input  then get the number and convert to real

Else

  • Convert the amount of millimetres correctly for 1/10 and 1/5

Alternative solution:

  • Use case with cmbRain itemindex to obtain the mm correctly
  • 0   : set mm to 0.1
  • 1   : set mm to 0.5
  • All other indexes set to correct mm amounts
  • End of case

Get inputs from spinedits
Calculate width * height * rain input / 150
Display in pnlBaths  rounded to 1 decimal place

11  
1.3

Button [1.3 Find rainfall type]
Check edtRain for integer input
Display a message  and exit  if not an integer

Alternative solution:

  • Use val
  • If icode <> 0  then showmessage  and exit

Get input from edtRain
Use case or nested if statements

  • 0   : lblraintype.Caption := 'No rain';
  • 1   .. 3 : lblraintype.Caption := 'Moderate rain';
  • 4 .. 7 : lblraintype.Caption := 'Heavy rain';
  • 8 .. 9 : lblraintype.Caption := 'Very heavy rain';  
  • 10 .. 50 : lblraintype.Caption := 'Heavy shower';  
  • else  lblraintype.caption := 'Flood';
13  
1.4

Button [1.4 Display Rainfall]

  • Loop 8 times
  • Use a loop  to generate two different  random numbersin range from 5 to 10
  • If a random number = 5
  • Then add 1 to LstQuantity index 0
  • If a random number = 10
  • Then add 1 to LstQuantity index 1

Calculate total quantity using LstQuantity items convertedto integer  
Display total in LstQuantity index 2 converted to string
Add LstQuantity values to heights of the two shapes
Correct shapes using correct items converted to integer

13  
TOTAL QUESTION 1 40  
QUESTION 2: DATABASE PROGRAMMING MAX. MARKS MARKS ACHIEVED
2.1.1 Button: [2.1.1] 3  
SQL: 'select * from Status order by Statusname DESC'

Concepts:

  • SELECT correct field
  • FROM correct table
  • ORDER BY correct field DESC
2.1.2 Button: [2.1.2] 3  
SQL: 'Select Birdname from Bird where Sightings < 200'

Concepts:

  • SELECT correct field
  •  FROM correct table  
  • WHERE Sightings <200
2.1.3 Button: [2.1.3] 4  
SQL: 'Select Birdname, Lastsighted from Bird where Birdname like ' + quotedstr('%' + sline + '%')

Concepts:

  • SELECT two correct fields  
  • FROM correct table  
  • WHERE Birdname LIKE  quotedstr('%' + sline + '%')
2.1.4 Button: [2.1.4] 4  
SQL: 'Delete from Bird where (StatusID = 6) OR (StatusID = 5)'

Concepts:

  • DELETE from Bird
  • WHERE StatusID = 6         OR  StatusID = 5
2.1.5 Button: [2.1.5] 3  
SQL: 'select Statusname, Birdname from Bird, Status where Bird.StatusID = Status.StatusID'

Concepts:

  • SELECT two correct fields
  • FROM two correct tables
  • WHERE clause to join two tables
2.1.6 Button: [2.1.6] 8  
'Select StatusID,format(avg(Sightings),"fixed",1) as AverageSightings from Bird where year(Lastsighted) = 2007 group by StatusID'
  • SELECT StatusID, format(avg  (Sightings),"fixed",2)
  • AS AverageSightings
  • FROM Bird
  • WHERE year(Lastsighted)  = 2007
  • GROUP by StatusID
 
  2.1 Subtotal: SQL 25  
2.2.1 Button: [2.2.1]
tblbird.First;
while not tblbird.eof do
if pos('EAGLE',uppercase(tblbird['Birdname']))  <>
0 then
reddisplay.Lines.Add(tblbird['Birdname']);
tblbird.Next;
6  
2.2.2 Button: [2.2.2]
icount := 0;
tblbird.First;
while not tblbird.eof do
begin
if tblbird['StatusID'] = 3 then
begin tblbird.Edit;
tblbird['StatusID'] := 2;  
tblbird.Post;  
inc(icount)
end;
tblbird.Next;
end;reddisplay.Lines.Add('Number of changes made = ' +
inttostr(icount));
9  
  2.2 Subtotal: Code constructs 15  
TOTAL QUESTION 2 40  
QUESTION 3: OBJECT-ORIENTATED PROGRAMMING MAX. MARKS MARKS ACHIEVED
3.1.1

Constructor Create:

  • Correct name  with four string parameters  
  • Set attributes to correct parameter values  
  • Set fQuantity to 1
4  
3.1.2

function getsightings: integer;

  • Correct method – integer function  
  • Return correct attribute fQuantity
2  
3.1.3

procedure increasequantity(iqty: integer);

  • Correct method – procedure
  • one integer parameter
  • Add parameter  to fQuantity
4  
3.1.4

function sightinggap: string;

  • Correct method – string function  
  • Get year  from todays year  
  • Get year from date attribute
  • Subtract attribute year from current year  as integers
  • Return result with correct words appended
7  
3.1.5

function tostring: string;

  • correct string method
  • result returned with string compiled with correct
  • attributes  use #13,  correct wording.  
  • UseSightingGap function
5  
  3.1 Subtotal: Object class 22  
3.2.1

Button [Q3.2.2]

  • Get inputs from two edits
  • Get input from combobox  and radiogroupbox
  • Get inputs from spineditsInstantiate the object
  • Object name =  tsighting.createwith four string parametersIn correct order
  • Display empty line in richedit
  • Use method of class  and object name to display
11  
3.2.2

Button [Q3.2.1]

  • Use object name  and method of the class  to increase quantity using sedSightings
  • Display in richedit using object name  and correct method
5  
  3.2 Subtotal: Form class 16  
TOTAL QUESTION 3 38  
QUESTION 4: PROBLEM SOLVING MAX. MARKS MARKS ACHIEVED
4.1
  • icount := 0; isum := 0;
  •  assignfile(myfile, 'water.txt');  
  • reset(myfile);
  • while not eof(myfile) do
  • readln(myfile, soneline);
  • inc(icount);
  • add type  to arrtypes
  • add quantity to arrqty
  • isum := isum + arrqty[icount];

  • for k := 1 to icount - 1 do
  • for l := k + 1 to icount do
  • if arrqty[k] > arrqty[l] then  
  • itemp := arrqty[k];
  • arrqty[k] := arrqty[l];  
  • arrqty[l] := itemp;
  • stemp := arrtypes[k];
  • arrtypes[k] := arrtypes[l];    
  • arrtypes[l] := stemp;

  • for k := 1 to icount do
  • reddisplay.Lines.Add(arrtypes[k] + #9 +
  • inttostr(arrqty[k]));
  • reddisplay.Lines.Add('Total number of people = ' +
  • inttostr(isum))
19  
4.2
  • for k := 1 to icount do
  • iperc := round  (arrqty[k]  /isum *100 );
  • arrperc[k] := iperc;

  • for k := 1 to icount do
  • sline := arrtypes[k] + #9;
  • case arrperc[k] of  (use end of case correctly)
  • 1..5 : sline := sline + 'X';
  • 6..10 : sline := sline +#9 +  'X';
  • 11..20 : sline := sline +#9 + #9 + 'X';  
  • 21..50 : sline := sline +#9 + #9 + #9 + 'X';  
  • end;
  • reddisplay.lines.add(sline); inside the loop
13  
TOTAL QUESTION 4 32  

SAMPLE SOLUTIONS

1 ajgdgada

2 ajguydad

Related Items

3 agada

4 ahftdad

5 yautfytdfa

6 a yujgdyuagd

7 au yygtuydgtad

8 a yguydgagd

9 ai yguydgauyd

Last modified on Monday, 14 March 2022 06:18