Professional Documents
Culture Documents
007 Array Tutorial01
007 Array Tutorial01
007 Array Tutorial01
DevelopingC++Program [16marks]
MarkingCriteria[8 marks]
1.Programprovidescommunicationthatisunderstandabletouser. 2.Programaccepts5inputsfromtheuser. 3.Programusesarray. 4.Programdisplayselementsofarrayintheordertheywereentered. 5.Programdisplayselementsofarrayinreverseorder. 6.Programusesfunctionstoallowusertoinputusesfunctionstodisplay. 7.Programusesfunctionstodisplaythearray. 8.Programusesfunctionstodisplaythearrayinreverseorder.
2. Linearsearchisamethodusedtofindanelementinalistofarrayelements.Itworksby comparingeachoftheelementswiththesearchitem. CreateaC++programthatallowsuserto: input10numbersasthearrayelements, sortsthenumbersinascendingorder, sortsthenumbersindescendingorder, promptsuserforanumbertobesearched, displaysthesearchresult, allowsusertochangeelementsinthearray, promptsuserifinputisinvalidand allowsusertorepeattheprogram. MarkingCriteria [10marks]
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Programprovidescommunicationthatisunderstandabletouser. Programusesfunctiontodisplaymenu. Programacceptsaninputandcallsthefunctionthatrepresentsthefunction. Functiontosortinascendingorderworkscorrectly. Functiontosortindescendingorderworkscorrectly. Functiontosearchanelementworkscorrectly. Functiontochangeanelementworkscorrectly. Functiontodisplayanelementworkscorrectly. Programkeepsonrepeatinguntiluserpromptstoquit. Functionthatpromptsvalidinputworkscorrectly.
SampleofOutputonthefollowingpage
Sampleofoutput:(Redboxindicatessampleofinput)
EndofQuestions