CMSC 132 Final Exam Questions with 100% Correct Answers | Verified | Latest Update 2024
Procedural abstraction - ANSSpecifies actions, hides algorithms Data Abstraction - ANSSpecifies data objects, hides representation Encapsulation - ANSConfine information so that it is only visible/accessible through an external interface Comparable - ANScompareTo, natural ordering Comparator - ANSSupports generics, separate classes for each ordering Iterator - ANSnext, hasNext, remove Iterable - ANSIterator<T> iterator(); Abstraction vs. Interfaces - ANSAbstract methods have inheritance, but you can implement multiple interfaces Abstract methods - ANSMethods that contain no body, subclasses provide implementation Abstract classes - ANSNecessary if there is an abstract method, can contain non-abstract methods Implementing equals - ANSPass in Object obj 1. obj==this, return true 2. (!(obj instanceof classA)), return false 3. A x=(A)obj; 4. Specific comparisons based on class A Cloning - ANSMakes a shallow copy Creating a variable in an inner class - ANSOuter.Inner in = Out.Inner(); GUI Model - ANSModel, View, Controller Creating a GUI - ANS1. Define a container 2. Choose a Layout Manager (FlowLayout, BorderLayout, GridLayout) 3. Add components (JCheckBox, JRadioButton, JTree) 4. Add actions/event listeners 5. Schedule processing in the EDT Comparing complexities - ANSlim f(n)/ n->inf g(n) if inf, f(n) is larger if 0, g(n) is larger Multiplicative Congruency Method - ANSHash value = M((a * keyValue) % N) N is table size, a is a large prime number Hash Code Contract - ANS1. If s(b) == true, then we must guarantee Code( ) == Code( ) 2. hashCode() Must return same value for an object each time, provided information used in equals( ) comparisons on the object is not modified User Datagram Protocol (UDP) - ANSUnreliable, packet oriented. Packets may get lost with no notification. Useful with small messages. Transmission Control Protocol (TCP) - ANSReliable, connection oriented Domain Name System (DNS) - ANSProtocol for translating domain names to IP addresses Uniform Resource Locators (URLs) - ANSConsists of protocol (http), IP address/domain name, port Client/Server Model - ANSClient initiates communication and requests services Software Life Cycle - ANS1. Problem specification 2. Program design 3. Algorithm and data structures 4. Coding and debugging 5. Testing and verification 6. Documentation and support 7. Maintenance Software Process Models - ANSWaterfall, Iterative, Unified, Agile Automated Testing - ANSThe software is tested by a completely automatic process Manual Testing - ANSA person uses the software, perhaps guided by a script, and notes bug Clear box testing - ANSAllowed to examine code, attempt to improve thoroughness of test Black box testing - ANSNo knowledge of code, test behavior in response to inputs Stub - ANSSkeleton code in place of unfinished method / class Mock objects - ANSSimilar to stubs, but they record calls and if the wrong calls are made to them, the test fails
Written for
- Institution
- CMSC 132
- Course
- CMSC 132
Document information
- Uploaded on
- July 3, 2024
- Number of pages
- 3
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cmsc 132 final exam questions with 100 correct an