Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The two pieces of code that follow have the same logical functionality but different structure. Which statement about them is TRUE? Version 1 . void

The two pieces of code that follow have the same logical functionality but different structure. Which statement about them is TRUE?
Version 1.
void foo(bool x, bool y){
if (x){
if (y) z();
}
else {
if (y) w();
}
}
Version 2.
void check_y_z(bool val);
void check_y_w(bool val);
void def foo(bool x, bool y){
if (x){
check_y_z(y);
}
else {
check_y_w(y);
}
}
void check_y_z(bool val){
if (val) z();
}
void check_y_w(bool val){
if (val) w();
}
Version 1 cannot be tested to 100% C2 coverage.
Version 1 has higher per-function cyclomatic complexity than Version 2.
Version 2 cannot be tested to 100% C2 coverage.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago