0% found this document useful (0 votes)
24 views11 pages

2019 - Marking - HNDIT2313 Object Oriented Analysis and Design

Uploaded by

dmaseni111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
24 views11 pages

2019 - Marking - HNDIT2313 Object Oriented Analysis and Design

Uploaded by

dmaseni111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 11
SLIATE Higher National Diploma in Information Technology ‘Second Year, Fist Semester Examination ~2019 HNDIT23130T3103 - Object Oriented Analysis and Design Model Answers Question oF (@. —Ditferatate between objec oriented analysis and object oriemied design. (Objet orented analysis ean be defined as investigation of objects. Design means collaboration of identified objects. ‘The most important purpose of OO analysis isto identify ebjects ofa system {be desiged, Analysis is also done for an existing system, ‘An efficient analysis i only possible when we are able to start thinking in a way where objects can be identified. After identifying the objects their "relationships are identified and finally the design Is produced. {06 Masks) (i. Define the tems coupling ad cobesion in the context of object oriented programming. Explain how coupling nd cohesion can lead to lth god or had soar design, Cohesion isthe indication of the relationship wit ‘module. Couplings the Indication ofthe relationships between modtles, Cohesion isa degree (quality) o which w component / mode focuses om the single thing, Coupling degree to which a component /medule is connected to the ather modules. (04 marks) Good design should go for high cohesion and low coupling. (01 mark) Gi, Give the object oriented terminology for each of the following object oriented features and supply an example of code tht illustrates the feature: 4) A blueprint for an object which defines all the data items contained inthe objet andthe operations that are permite for the dats. ‘This is known asa class (Ol mark) Forany correct example (02 mks) 1) A represention of something within the domain tat the program models ‘hich contains values of data and which implements opeations on that data, ‘This san object (Ot mark) For any correct example (02 mals) ©) Amopertion which will manipulate the dat contained inan object. ‘This isknown asa method (01 mark) Forany correct example (02 marks) (0 marks) (Fotat 20 marks) Question 02 ©. Letine the terms encapsulation and dita hiding and deste the reationship between them, Encapsulation relates (0 the packaging (binding) together of dat ‘operations (eg, to form classes in the object oriented paraligm). A common ‘objective of eneapsuation Isto prevent data from being vibe outside the ‘encapsulated unit in which itis defined, except through methods that can ‘therefore control access and monitor the validity ofthat dats they arbitrate [In that sense it also accomplishes data hiding where class members that we ‘wish tobe inaccessible outside the elas are designated private. (02 marks) and Data hiding i a more general term that entals secreting certain details of an Implementation (data or fonctions) away from the user to prevent them being, aceldentall or ineationally damaged, and also to simplify the programmer's view ofthe system, This may be va through the nse of private members im a 2 nvorr23 217303 Object vent Andis amd Dein 2019 Semesir reused class (Le, encapsulation), but canals be implemented using Mbraris, ‘the invocation of pre-compiled program components, and other means. (Comarks) (How does method overloading differ from method overiing? ‘Method Overloading: Having several versions ofthe same method name, but ‘with different signatures. The appropriate verson is execute, depending upon ‘the arguments passed when the method is invoked. (2 maeks) Method Overriing: Creating of wo or more methods withthe same name and signature in diferent classes inthe class hierarchy (Le, super-class and sub- 1) such that for example) a sub-class version can overshadow an inherited (uper-0) ‘avnr25 131103 Objet One Anais and Dein 209 emer { protons = Ps return true; , return floes } boolean setNeutrons (nt N) { iten>o) { neutrons = Ns ) return false; } boolean setEletrons(int E) t eE>0) {electrons = Bs return true; ) return false; } gstProtons( {ret {nc getNeuteons0 {return neutrons | int getEleetrons) {return electrons; } ‘arabe declaration ———-(01 mark) Constructor {02 mark) ~ (03 mars) (03 marks) 1) Write «new method forthe atom class called getAtomieMassNumber that wil clcuat and return the atomic mass numberof the atom (din: Atom mass number ofan atom = number of protons + numberof neutrons) public int getAtomieMassNumber | return protons + neutrons; } (03 marks) (Total 20 marks) ‘Question 3 (. Whatis the main pupose of use case modeling? To.capture the software's funetonal requirement. (03 murs) Luvonr2312173108~ Oe vend dns and Design 209 Semester Gi, Describe the meaning of <> and > in a UML usecase Aiagrams -<> implies generalistion relationship in which he extending usecase continues (Le. adds more unetonality fo) the Behaviour of dhe base use ease ‘extending we ease is optonal and may be invoked depending up a condition, Smarts) hip that ental the inelaion of « <> implies » generaliation rea behaviour defined in another use-ase The inladed ws ease is mandatoriy invoked, and the se use ease is incomplete without it. 2.Smarks) (Gi), Drawn usecase diagram forthe following Hospital Management Sytem, “The hospital has several specialized departments ike Cardiology, Gynecologic, Orthopedics, Poditris, ENT ee. OPD is another independent department. A doctor is ony associated with one specialized department ata tine though he/she «cam be a member ofthe OPD (Outside Patients Department. Eich doctor has 8 sting time and day ina week _Atreception he ptint detail are entered andthe fees ar alo taken andthe patent is tracked onthe basis ofthe ID generated. In routine a patient can visi the doctors cither diretly selecting «doctor or by getting admitted to the hospital and then a doctor vss the pation ‘A doctor can prescribe tests for the patent to perform. The paint vst the lab to {get done the ests presribed by hisher doctor, The reports are given othe patent ‘The payments pertaining tthe ets are done atthe reception. Referring the reports, the doctor prescribes the patient medicines or further tests or is asked to get dived. [A patent is admited into a ward ofa specialized department (i available) as per ‘he doctors prescription. The numberof wards is limited andi there is mo vacant ‘ward the admission ofthe patient is rescheduled As per the presrition of the doctor the patient is operated on a speifed date and lime as decided by the doctor who is doing the operation ‘Aftor the completion ofthe weatment a patient may get discharged onan ave of| ‘doctor and upon the complete payment of all due charges atte reepton. On vo 2313 073103 Objet Oriente Anaad Desig 2018 Semester ‘payment of fll dus the reception generates discharge ket fo the patient. (12 marks) (Coat 20 mars) Question 4 (0. Brioty describe the pupeseof drawing component gram. ‘Component diagrams represent ast of components and thir relationships, So Component diagrams represent the implementation view ofa system. Daring design phase software artifacts (lasses, interfaces el) ofa system are arranged indifferent groups depending upon their relatcaship. Now these groups are known as components. Finally, component diagrams are used to visualize the implementation. (03 marks) ANDI231¥13105—Oljet Ose ray and Bes 2019 Somer, i). Show bow composition and ageregation inler

You might also like