Final exam year, questions PDF

Title Final exam year, questions
Course Foundations Of C++
Institution Monash University
Pages 6
File Size 181 KB
File Type PDF
Total Downloads 46
Total Views 146

Summary

Download Final exam year, questions PDF


Description

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Office!Use!Only! !

Monash'University' ' '

SAMPLE'EXAM' ' Faculty'of'Information'Technology' ! EXAM'CODES:' FIT1048' ' TITLE'OF'PAPER:' Foundations'of''C++' ! EXAM'DURATION:! 3!hours!writing!time! ! READING'TIME:! 10!minutes! ! THIS%PAPER%IS%FOR%STUDENTS%STUDYING%AT:(%tick%where%applicable)% o 'Berwick! x 'Clayton! o 'Malaysia! o 'Off!Campus!Learning! o 'Open!Learning! o 'Caulfield! o 'Gippsland! o 'Peninsula! o 'Enhancement!Studies!! o 'Sth!Africa' o 'Pharmacy! o 'Other!(specify)! ! ! During!an!exam,!you!must!not!have!in!your!possession,!a!book,!notes,!paper,!electronic!device/s,! calculator,!pencil!case,!mobile!phone!or!other!material/item!which!has!not!been!authorised!for!the! exam!or!specifically!permitted!as!noted!below.!Any!material!or!item!on!your!desk,!chair!or!person!will! be!deemed!to!be!in!your!possession.!You!are!reminded!that!possession!of!unauthorised!materials!in!an! exam!is!a!discipline!offence!under!Monash!Statute!4.1.! ! %

No!examination!papers!are!to!be!removed!from!the!room.! ' ' AUTHORISED'MATERIALS' ! CALCULATORS' o 'YES' x 'NO' ' OPEN'BOOK' o 'YES' x 'NO' ' SPECIFICALLY'PERMITTED'ITEMS' o 'YES' x 'NO' if'yes,'items'permitted'are:! ! ! ! ! Candidates%must%complete%this%section%if%required%to%write%answers%within%this%paper% ! ! STUDENT!ID! ! __!__!__!__!__!__!__!__! ! !!!!!DESK!NUMBER! __!__!__!__!! ! ! ' Page 1 of 6

Instructions'to'Candidates:' 1. The!examination!is!out!of!100!marks.!Marks!for!individual!sections!and!questions!are!clearly! indicated!throughout!the!exam!paper.! 2. Answer!all!questions!in!the!provided!exam!script!books,!NOT!in!the!exam!paper.! 3. You!may!answer!the!questions!in!any!order.!Boldly!number!your!answers!to!all!questions.! Commence!all!sections!on!a!new!page.! 4. Write!your!answers!on!the!lined!pages!of!the!exam!script.!You!may!use!the!blank!sides!of!the! page!for!workings,!however!these!pages!will!not!be!marked.! 5. State!any!assumptions!that!you!make!regarding!any!question.! !

Page 2 of 6

Section'A:'Short'Answer'Questions'(30'marks'total)' 1. #include !and!using namespace std;!are!two!lines!of!code!we! typically!include!in!our!c++!programs.!What!do!these!two!lines!do?!Why!do!we! typically!need!them?![3!marks]! 2. A!break!statement!is!common!in!most!switch!statements,!however!it!is!not!mandatory.! What!is!the!purpose!of!including!a!break!statement!in!a!switch!statement?!What!will! happen!if!it!is!not!included?![3!marks]! 3. A!well!authored!header!file!can!be!all!we!need!to!understand!how!to!use!a!pre-existing! class.!Explain!why!this!is!so!by!describing!what!we!typically!include!in!a!header!file!for! a!class.![3!marks]! 4. Vectors!and!Arrays!are!2!of!the!main!storage!options!for!keeping!collections!of!data!in! C++.!Describe!the!similarities!and!differences!between!these!two,!highlighting!when! you!would!likely!choose!one!over!the!other.![3!marks]! 5. What!is!considered!good!programming!practice!to!do!when!you’ve!created!an!object! with!the!new!command?!Why?![3!marks]! 6. What!do!we!mean!by!“dereferencing”!a!pointer?!Provide!example!in!code!of!when!we! may!use!a!pointer!normally!and!dereferenced.![3!marks]! 7. In!C++!we!can!have!multiple!constructors!for!one!class,!but!only!one!destructor.! Explain!why!this!is!the!case!using!code!to!highlight!why.![3!marks]! 8. What!is!operator!overloading?!Provide!a!practical!example!of!when!we!would!use!this.! [3!marks]! 9. Polymorphism!allows!us!to!keep!collections!of!different!types!of!related!objects.! Explain!how!this!is!so!using!a!practical!example![3!marks]! 10. Singletons!and!Factory!are!two!object-oriented!design!patterns!that!we!can!utilise!in! our!program!design.!Briefly!explain!each!and!provide!a!practical!example!of!when!we! may!choose!to!use!that!design!pattern.![3!marks]!

Page 3 of 6

Section'B:'Short'Coding'Questions'(40'marks'total)' 1. The!following!code!does!not!perform!as!expected.!What!is!happening?!Fix!the!code!so! that!it!performs!the!task!correctly.![6!marks]! ! int main() { int num1 = 13; int num2 = 7; numberModifier(num1, num2, 3); cout...


Similar Free PDFs