What element(s) of the WRSPM model belong in the system (including the overlap between environment and system)?
A. S
B. W,R,S
C. S,P,M
D. S,P
E. W
F. R,S
G. W,R
H. R,S,P
I. P,M
J. M What element(s) of the WRSPM model belong in the environment (including the overlap between environment and system)?
A. W
B. W,R
C. W,R,S
D. R,S
E. R,S,P
F. S
G. S,P
H. S,P,M
I. P,M
J. M The 5 "Whys" to be considered during a Root Cause Analysis are...?
A. Why, Why, Why, Why and Why
B. Who, Who, Who, Who, and Who
C. Who, What, When, Where and Why
D. Who, Why, Why not, When, What While calculating LCOM4, we ignore constructors and destructors. Constructors and destructors frequently set and clear all variables in the class, making all methods connected through these variables, which increases cohesion artificially.
LCOM4 = 1 indicates a cohesive class, which is the "good" class.
LCOM4 >= 2 indicates a problem. The class should be split into so many smaller classes.
LCOM4 = 0 happens when there are no methods in a class. This is also a "bad" class.
Calculate the value of the LCOM4 measurement for the following code:
#include "src/route.h"
Route::Route(std::string name, Stop * stops, double distances,
int num_stops, PassengerGenerator * generator) {
//Constructors ignored in LCOM4 calculation
}
void Route::Update() {
GenerateNewPassengers();
for (std::list<Stop *>::iterator it = stops_.begin();
it != stops_.end(); it++) {
(*it)->Update();
}
}
bool Route::IsAtEnd() const {
return destination_stop_index_ >= num_stops_;
}
void Route::NextStop() {
destination_stop_index_++;
if (destination_stop_index_ < num_stops_) {
std::list<Stop *>::const_iterator iter = stops_.begin();
std::advance(iter, destination_stop_index_);
destination_stop_ = *iter;
} else {
destination_stop_ = (*stops_.end());
}
}
Stop * Route::GetDestinationStop() const {
return destination_stop_;
}
double Route::GetTotalRouteDistance() const {
int total_distance = 0;
for (std::list<double>::const_iterator iter = distances_between_.begin();
iter != distances_between_.end();
iter++) {
total_distance += *iter;
}
return total_distance;
}
double Route::GetNextStopDistance() const {
std::list<double>::const_iterator iter = distances_between_.begin();
std::advance(iter, destination_stop_index_-1);
return iter; // resolving the iterator gets you the Stop from the list
}
int Route::GenerateNewPassengers() {
// returning number of passengers added by generator
return generator_->GeneratePassengers();
} 5th Edition•ISBN: 9781118898208Jack T. Marchewka346 solutions
9th Edition•ISBN: 9781118063330 (2 more)Abraham Silberschatz, Greg Gagne, Peter B. Galvin489 solutions
7th Edition•ISBN: 9780077475864James Fitzsimmons, Mona Fitzsimmons103 solutions
3rd Edition•ISBN: 9780262033848 (2 more)Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen726 solutions