help a lost soul

Rowan Corben rowan@corben.fslife.co.uk
Fri, 1 Mar 2002 00:52:51 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C1C0BB.6A5D95E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

sir,
i have been set an assignment by my university....we are so badly taught =
that i have absolutley no idea how to do it! I would be more than happy =
to post payment for however much you feel your time is worth...

Please,please help:

ex.1)    Extend to the library database to include category of loan for =
overnight + 4 week loans-you should use the following data types.The =
TIME and DATE are the due time and date for books.You should provide =
enough data to reasonably test your code.

data LoanType   =3D Overnight Date Time | FourWeek Date
                            deriving (Show,Read)
data Time         =3DTime (Hours,Minutes)
                               deriving (show,Read)
data Date           =3DDate (Year,Month,DayNum)
                                deriving (Show,Read)
type Hours        =3D Integer
type Minutes     =3DInteger
type Year       =3D   Integer
type DayNum    =3DInteger
data Month    =3D =
January|Februrary|March|April|May|June|July|August|September|October|Nove=
mber|December
           deriving (Eq,Ord,Enum,Show,Read)

overdue books are fined at the following rates:

OVERNIGHT the due time is 24 hours from the time borrowed to the nearest =
hour above (for example,a book borrowed at 12.35 would be due back at =
13.00 the next day).Overdue books are fined at 0.1p per minute rounded =
to the nearest penny.

FOURWEEK the due date is four weeks from the borrowing date.Overdue =
books are fined at 10p per day



ex.2)   To calculate fines you will need to impliment functions over =
DATE and TIME.You will also need a data type to represent time periods:

      data TimePeriod  =3D TimePeriod (Days,Hours,Minutes)
                                   deriving (Eq,Ord,Show,Read)
      type Days            =3D Integer

*afterTime      which takes two times and returns True if the first is =
after the second.
*beforeTime      which takes two times and returns True if the first is =
before the 2nd                                                           =
                    =20
*timeBetween      which takes two times and returns the time between the =
first and the 2nd
*timeIncr    which takes a time and a time period and returns a new time =
(time should be represented as a 24 hour clock
*timeTo24String       which takes a tim eand displays it as a string in =
24hr format
*timeTo12String         which takes a time and displays it as a string =
in 12 hour format


ex.3)    Make DATE and TIME instances of the type classes Eq and Ord

ex.4)    For overnight books most fines are on the same day-write a =
function that takes a book and a time and calculates the fine on the =
book (assuming it is returned on the due date but after the due time).


If you could help i will be extreamly =
gratefull!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
haskinsgreg@hotmail.com                                      =20

------=_NextPart_000_0005_01C1C0BB.6A5D95E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>sir,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i have been set an assignment by my=20
university....we are so badly taught that i have absolutley no idea how =
to do=20
it! I would be more than happy to post payment for however much you feel =
your=20
time is worth...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Please,please help:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ex.1)&nbsp;&nbsp; &nbsp;Extend to the =
library=20
database to include category of loan for overnight + 4 week loans-you =
should use=20
the following data types.The TIME and DATE are the due time and date for =

books.You should provide enough data to reasonably test your =
code.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>data LoanType&nbsp;&nbsp; =3D Overnight =
Date Time |=20
FourWeek Date</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;=20
deriving (Show,Read)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>data=20
Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3DTime=20
(Hours,Minutes)</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
deriving (show,Read)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>data=20
Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3DDate =

(Year,Month,DayNum)</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
deriving (Show,Read)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>type=20
Hours&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3D Integer</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>type Minutes&nbsp;&nbsp;&nbsp;&nbsp;=20
=3DInteger</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>type =
Year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&nbsp;&nbsp; Integer</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>type DayNum&nbsp;&nbsp;&nbsp; =
=3DInteger</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>data Month&nbsp;&nbsp;&nbsp; =3D=20
January|Februrary|March|April|May|June|July|August|September|October|Nove=
mber|December</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
deriving=20
(Eq,Ord,Enum,Show,Read)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>overdue books are fined at the =
following=20
rates:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>OVERNIGHT the due time is 24 hours from =
the time=20
borrowed to the nearest hour above (for example,a book borrowed at 12.35 =
would=20
be due back at 13.00 the next day).Overdue books are fined at 0.1p per =
minute=20
rounded to the nearest penny.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>FOURWEEK the due date is four weeks =
from the=20
borrowing date.Overdue books are fined at 10p per day</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ex.2)&nbsp;&nbsp; To calculate fines =
you will need=20
to impliment functions over DATE and TIME.You will also need a data type =
to=20
represent time periods:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data=20
TimePeriod&nbsp; =3D TimePeriod (Days,Hours,Minutes)</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;deriving (Eq,Ord,Show,Read)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type=20
Days&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
=3D=20
Integer</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>*afterTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; which=20
takes two times and returns True if the first is after the =
second.</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>*beforeTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; which=20
takes two times and returns True if the first is before=20
the&nbsp;2nd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>*timeBetween&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; which=20
takes two times and returns the time between the first and=20
the&nbsp;2nd</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>*timeIncr&nbsp;&nbsp;&nbsp; which takes =
a time and=20
a time period and returns a new time (time should be represented as a 24 =
hour=20
clock</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>*timeTo24String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
which takes a tim eand displays it as a string in 24hr =
format</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>*timeTo12String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
which=20
takes a time and displays it as a string in 12 hour format</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ex.3)&nbsp;&nbsp;&nbsp; Make DATE and =
TIME=20
instances of the type classes Eq and Ord</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ex.4)&nbsp;&nbsp;&nbsp; For overnight =
books most=20
fines are on the same day-write a function that takes a book and a time =
and=20
calculates the fine on the book (assuming it is returned on the due date =
but=20
after the due time).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If you could help i will be extreamly=20
gratefull!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>haskinsgreg@hotmail.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C1C0BB.6A5D95E0--