Software Engineering II MCQs with Answers
Practice important Software Engineering II MCQs with answers and explanations.
Chapter: 43
Q1241:
In refactoring, after moving a method, what should be done next?
A. Create a new project
B. Adjust references to the method
C. Delete all rentals
D. Reset customer details
Correct Answer:
B
Chapter: 43
Q1242:
In the statement() method, the variable thisAmount was considered _______.
A. Essential
B. Redundant
C. Important
D. Dynamic
Correct Answer:
B
Chapter: 43
Q1243:
Temporary variables should be replaced by _______ for better code readability.
A. Queries
B. Loops
C. Arrays
D. Functions
Correct Answer:
A
Chapter: 43
Q1244:
The method to calculate frequent renter points was moved to the _______ class.
A. Movie
B. Rental
C. Customer
D. Tape
Correct Answer:
B
Chapter: 43
Q1245:
In the final refactored code, how are frequent renter points calculated?
A. Using a hardcoded value
B. Using frequentRenterPoints() method in Rental
C. Using Customer's ID
D. Using Movie length
Correct Answer:
B
Chapter: 43
Q1246:
The method frequentRenterPoints() returns 2 points if _______.
A. A regular movie is rented for 1 day
B. A new release movie is rented for more than 1 day
C. A children's movie is rented for 2 days
D. A new release is rented for 1 day
Correct Answer:
B
Chapter: 43
Q1247:
In the statement() method, what is appended to the result string for each rental?
A. Movie price
B. Movie name and charge
C. Customer name
D. Rental duration
Correct Answer:
B
Chapter: 43
Q1248:
Refactoring often involves taking _______ steps to avoid errors.
A. Huge
B. Small
C. Parallel
D. Random
Correct Answer:
B
Chapter: 43
Q1249:
In the Rental class, the charge() method uses a _______ statement to determine the price.
A. if-else
B. try-catch
C. while loop
D. switch
Correct Answer:
D
Chapter: 43
Q1250:
When a movie is of type NEW_RELEASE, the rental charge is _______ per day.
A. 1.5
B. 2
C. 3
D. 4
Correct Answer:
C
Chapter: 43
Q1251:
Which variable holds the total frequent renter points earned?
A. totalAmount
B. rentals
C. frequentRenterPoints
D. totalCharge
Correct Answer:
C
Chapter: 43
Q1252:
In the Rental class, which method is responsible for returning the rental's movie name?
A. rentalName()
B. tape().movie().name()
C. movieTitle()
D. getRentalName()
Correct Answer:
B
Chapter: 43
Q1253:
What is the purpose of the frequentRenterPointOf(Rental each) method?
A. To calculate rental charge
B. To calculate frequent renter points
C. To display rental details
D. To reset rentals
Correct Answer:
B
Chapter: 43
Q1254:
Temporary variables in long methods often lead to _______.
A. Better code structure
B. Complex and confusing code
C. Faster execution
D. Secure code
Correct Answer:
B
Chapter: 43
Q1255:
After refactoring, frequent renter points calculation became the responsibility of the _______ class.
A. Customer
B. Rental
C. Movie
D. Tape
Correct Answer:
B
Chapter: 43
Q1256:
In Rental.charge(), how much is added if a REGULAR movie is rented for 4 days?
A. 2
B. 3
C. 5
D. 6
Correct Answer:
C
Chapter: 43
Q1257:
In Rental.charge(), the base charge for a CHILDREN'S movie is _______.
A. 1
B. 2
C. 1.5
D. 3
Correct Answer:
C
Chapter: 43
Q1258:
Which of the following is NOT a type of movie price code handled in charge()?
A. REGULAR
B. NEW_RELEASE
C. CHILDRENS
D. DOCUMENTARY
Correct Answer:
D
Chapter: 43
Q1259:
In the refactored statement method, frequent renter points are updated using which operator?
A. =
B. +=
C. -=
D. *=
Correct Answer:
B
Chapter: 43
Q1260:
In the statement() method, the rental list is accessed using _______.
A. Enumeration
B. Iterator
C. List
D. Collection
Correct Answer:
A