Cut-OffDate:TBA
CourseCode:M251
CourseTitle:ObjectOrientedProgrammingUsingJavaTutorMarkedAssignment
TotalMarks:80
ThisTMAcoversthefirst7sessionsofM251.Itisrequiredtodothefollowing:
•
•
•
•
CreateaJavaprojectusingyourIDEandnameitusingyournameandyourstudentIDImplementalltherequiredclassesinthedefaultpackage
CreateaWordfilecontainsthefollowing:
oAnswerofthegivenquestions
oAcopy(not a snapshot)ofthecodeofeachclass
oAcompletesnapshotoftheoutput
oIfpartofthecodedoesnotwork,trytoexplainyouridea
oTheheaderofeachpageshouldcontainyournameandyourstudentID
OnLMSpageofM251,thereare2linksandyoushouldsubmit2files(onefileperlink):oTheWordfileyoucreated
oAcompressedfilecontainsthefolderofyourJavaproject
PlagiarismWarning:
AsperAOUrulesandregulations,allstudentsarerequiredtosubmittheirownTMAworkandavoidplagiarism.TheAOUhasimplementedsophisticatedtechniquesforplagiarismdetection.Youmustprovideallreferencesincaseyouuseandquoteanotherperson'sworkinyourTMA.YouwillbepenalizedforanyactofplagiarismaspertheAOU'srulesandregulations.
DeclarationofNoPlagiarismbyStudent(tobesignedandsubmittedbystudentwithTMAwork):
IherebydeclarethatthissubmittedTMAworkisaresultofmyowneffortsandIhavenotplagiarizedanyotherperson'swork.IhaveprovidedallreferencesofinformationthatIhaveusedandquotedinmyTMAwork.
NameofStudent:
Signature:
Date:
1
Overview:
COVID-19caseshavebeenincreasedinthelastperiod.Asaresult,MinistryofHealthhasdecidedtomakeasimpleapplicationtokeeptrackofallcitizensandtheirvaccinationstatus.InthisTMA,itisrequiredtohelptheMinistryimplementtherequiredapplication.
Requirements:
Afteraquickmeetingwiththeemployeeincharge,yougotthefollowinginformation:
•Itisrequiredtostorethewholedatainonecollection
•EachcitizenhasauniquecivilIDnumber(nationalnumber),nameandotherattributes(addatleast2attributesfromyourchoice).Inaddition,itisrequiredtostoreinformationaboutalldosestakenbythecitizen.
•Foreachdose,thefollowinginformationshouldbestored:manufacturer,whenandwherehasbeentaken,andinformationaboutthehealthprofessionalwhogaveit.
•EachhealthprofessionalhasauniquecivilIDnumber,name,anditisrequiredtostorehis/herexperience(inyears).
Moreover,youhavebeeninformedthatthefollowingoperationshappenfrequently:
•Addinganewcitizentothelist
•Addinganewdosetoaspecifiedcitizen
•Retrievingnumberoffullyvaccinatedpersons(whotokeatleast2doses)
•SavingallthedataintoatextfileaftersortingthemaccordingtoCivilID.
Analysis:
Q1:Therearecommonattributesandmethodsbetweencitizenandhealthprofessional.Whatisthebestchoicefordesigningandwritingthecodesofthesetwoclasses?Explainyouranswer.
Q2:Drawasimpleclassdiagramshowingonlyrelationshipsbetweentheclasses.Implementation:
Afteranalysingthegivenrequirements,implementtherequiredapplication:
•withObject Oriented Programmingstyle
•followingtherulesofgoodprogrammingstyle(e.g.addingcomments,etc.)
•usingonly the material covered in M251(anditsprerequisites)
Hints:
•Foreachclass,itisrequiredtoimplementconstructors,setters,getters,toString()method,andanyothernecessarymethod
2