问答题

阅读下列说明,回答问题1至问题3。[说明] 基本路径法设计出的测试用例能够保证在测试中程序的每一条可执行语句至少执行一次。以下代码由C++语言书写,请按要求回答问题。 void ReadPara(CString temp) { if(temp==">=") m_oper.SetCurSel(0); else { if(temp==">") m_oper.SetCurSel(1); else { if(temp=="==") m_oper.SetCurSel(2); else { if(temp=="<=") m_oper.SetCurSel(3); else { if(temp=="<") m_oper.SetCurSel(4); else m_oper.SetCurSel(5); } } } } return; } 请计算上述控制流图的环路复杂度V(G)。

【参考答案】

正确答案:V(G)=6