Software Engineering II MCQs with Answers
Practice important Software Engineering II MCQs with answers and explanations.
Chapter: 42
Q1221:
What two reusable functions were created from the selection sort refactoring?
A. swap() and find()
B. minimum() and swap()
C. sort() and swap()
D. minimum() and sort()
Correct Answer:
B
Chapter: 42
Q1222:
In selection sort, swap() function is used to _______.
A. Compare elements
B. Exchange values
C. Find minimum
D. Sort list
Correct Answer:
B
Chapter: 42
Q1223:
In the Video Store example, the base class holding a name is called _______.
A. Movie
B. DomainObject
C. Customer
D. Rental
Correct Answer:
B
Chapter: 42
Q1224:
In the Movie class, what field holds the pricing information?
A. _name
B. _serialNumber
C. _priceCode
D. _daysRented
Correct Answer:
C
Chapter: 42
Q1225:
What method is used to save a Movie instance to the registrar?
A. store()
B. save()
C. persist()
D. get()
Correct Answer:
C
Chapter: 42
Q1226:
The method used to retrieve a Movie instance from the registrar is called _______.
A. store()
B. get()
C. load()
D. fetch()
Correct Answer:
B
Chapter: 42
Q1227:
A Movie object has a method priceCode() to _______.
A. Set movie name
B. Set rental price
C. Retrieve price code
D. Save movie details
Correct Answer:
C
Chapter: 42
Q1228:
The Rental class is used to track the _______.
A. Movie’s availability
B. Customer’s points
C. Customer renting a movie
D. Tape stock
Correct Answer:
C
Chapter: 42
Q1229:
The Customer class holds the _______ for the system.
A. Behavior
B. Data only
C. Movie tapes
D. Price code
Correct Answer:
A
Chapter: 42
Q1230:
In the refactoring example, the Registrar is used to _______.
A. Book tickets
B. Track movies and tapes
C. Increase rentals
D. Manage customers
Correct Answer:
B
Chapter: 42
Q1231:
In the refactoring philosophy, "bad smells" are indicators of _______.
A. Bugs
B. Optimization issues
C. Poor code quality
D. Good practices
Correct Answer:
C
Chapter: 42
Q1232:
Primitive obsession is the overuse of _______.
A. Complex classes
B. Primitive data types
C. Interfaces
D. Inheritance
Correct Answer:
B
Chapter: 42
Q1233:
Which smell occurs when two classes know too much about each other’s details?
A. Inappropriate Intimacy
B. Feature Envy
C. Middle Man
D. Lazy Class
Correct Answer:
A
Chapter: 42
Q1234:
Which refactoring example was related to consolidating duplicate fragments?
A. Selection sort
B. Movie Rental system
C. Price calculation based on special deals
D. Data clumps removal
Correct Answer:
C
Chapter: 42
Q1235:
Bad smell of "Data Clumps" refers to attributes that _______.
A. Are not used
B. Clump together unnecessarily
C. Belong to multiple classes
D. Are inherited wrongly
Correct Answer:
B
Chapter: 42
Q1236:
Which class is responsible for renting tapes?
A. Customer
B. Tape
C. Rental
D. Movie
Correct Answer:
C
Chapter: 43
Q1237:
Moving a method to a class where it logically belongs is called _______.
A. Refactoring
B. Redesigning
C. Recoding
D. Reloading
Correct Answer:
A
Chapter: 43
Q1238:
In the given code, the method charge() is moved to which class?
A. Movie
B. Rental
C. Customer
D. Tape
Correct Answer:
B
Chapter: 43
Q1239:
Which value is returned by the charge() method when a REGULAR movie is rented for 1 day?
A. 2
B. 3
C. 1.5
Correct Answer:
A
Chapter: 43
Q1240:
In the charge() method, what happens if a CHILDREN'S movie is rented for more than 3 days?
A. Extra amount is added
B. No change
C. Rental is cancelled
D. Bonus points are added
Correct Answer:
A