[Year 12 SofDev] FW: VITTA practice exam Sample 2 - a few queries

Kevork Krozian kevork at edulists.com.au
Fri Oct 14 22:39:47 EST 2011


Hi Friends and Colleagues,

 I am inviting discussion and feedback on my interpretation of the VITTA
practice exam number 2

I have read the following a number of times so unless I have made a
mistake here are my comments for Q6, Section C.

The algorithm question in Q6 Section C has a number of problems:

1. If age CustomerAge is calculated as a real or float it will return a
fraction of a year eg. 60.7 or whatever since Fred Watson born 3/3/51 is
60 years and 7 months for example. This will make the test If CustomerAge
> 60 true and not necessary to be changed to If CustomerAge >=60 since
3/3/11 has passed ( 60 years exactly from the DOB of Fred on 3/3/51 ) .

2. The comments section that the number of trips is being stored in a 2D
array is not correct. CustomerTripInfo[NextCustomerID].NumTrips is a
reference to a field (NumTrips)  in an array of records
(CustomerTripsInfor[NextCustomerInfo] )

3. The counter for NumTrips only adds 1 or increments if a CustomerID is
repeated and not when it appears once:
      If LastCustomerID = NextCustomerID
     CustomerTripInfo[NextCustomerID].NumTrips <-
CustomerTripInfo[NextCustomerID].NumTrips + 1
   Therefore the counter is out by 1.
  This also assumes the initial value of
CustomerTripInfo[NextCustomerID].NumTrips is 0 which is not certain. So, I
get the following for NumTrips :
       CustomerID  NumTrips
		1344      1
		1451 	  0
  		2942	  1
    		31256	  0

  A better way to do this would be
 Repeat
 	Read NextCustomerID From AllCustomers
	If LastCustomerID = NextCustomerID
		     CustomerTripInfo[NextCustomerID].NumTrips <-
CustomerTripInfo[NextCustomerID].NumTrips + 1
	Else
	     CustomerTripInfo[NextCustomerID].NumTrips = 1
	LastCustomerID <- NextCustomerID
Until NextCustomerID = Blank

4. The error regarding the If CustomerAge <= 16 should be changed to If
CustomerAge < 16 as stated in the solutions.

5. The division by 20 instead of is also another mistake (subsequently
picked up) :
    If CustomerAge > 60
		FareTotal <- FareTotal - FareTotal /20
Should be

            If CustomerAge > 60
		FareTotal <- FareTotal - FareTotal /5    // to get a 20%
discount

6. In the solutions given the expected fare for 1344 is $6.00 whereas it
should be expected to be $4.00 for 2 trips. The actual will be $2 for the
reasons outlined in (1) above.

Also Q4 Section C, shows External Entity E as "Depot" .  I would have
thought "Customer" would have been the external entity supplying
CustomerID, CustomerTrips to the system even though it is being batch
processed at the end of the day from the depot through the wireless link.

Comments ??


Speak soon

Kevork




More information about the sofdev mailing list