试题详情

阅读下列C程序,回答下列问题。 [C程序] int GetMaxDay( int year, int month ) { int maxday = 0; //1 if ( month >= 1 && month <= 12 ) { //2, 3 if ( month == 2 ) { //4 if ( year % 4 == 0 ) { //5 if ( year % 100 == 0 ) { //6 if ( year % 400 == 0 ) //7 maxday=29; //8 else //9 maxday = 28;} else //10 maxday = 29; } else //11 maxday = 28; } else{ //12 if (month==4||month==6||month==9||month==11) //13, 14, 15, 16 maxday = 30; //17 else //18 maxday = 31; } } return maxday; //19 }3.1、请针对上述C程序给出满足100%DC(判定覆盖)所需的逻辑条件。(6分)3.2、请画出上述程序的控制流图,并计算其环路复杂度V(G)。(9分)3.3、请给出问题2中控制流图的线性无关路径。(5分)