1. Diketahui PDL mencari nilai maksimum, sbb :
START
int A,B,C,MAKS,MIN;
1 INPUT ”Nilai A : ";
INPUT ”Nilai B : ";
INPUT ”Nilai C : ";
2 IF (A>B)
3 IF (A>C)
4 Maks = A;
5 ELSE Maks = C;
6 ENDIF
7 ELSE IF ( B>C )
8 Maks = B;
9 ELSE Maks = C;
10 ENDIF
11 ENDIF
CETAK "Nilai Maksimum : ", Maks;
12 END
Buatlah flowgraph dan carilah cyclometic complexity-nya
V(G) = Region = 4
V(G) = Predicates Nodes + 1 = nodes (2,3,7) + 1
= 3 + 1 = 4
V(G) = Edges – Nodes + 2 = 14 – 12 + 2 = 4
atau = 12 – 10 + 2 = 4
2. diketahui PDL sbb mencari nilai minimum, sbb:
START
int A,B,C,MAKS,MIN;
1 INPUT ”Nilai A : ";
INPUT ”Nilai B : ";
INPUT ”Nilai C : ";
2 IF (A3 IF (A
5 ELSE Min = C;
6 ENDIF
7 ELSE IF (B
9 ELSE Min = C;
10 ENDIF
11 ENDIF
12 CETAK "Nilai Minimum : ", Maks;
END
Buatlah flowgraph dan carilah cyclometic complexity-nya
V(G) = Region = 4
V(G) = Predicates Nodes + 1 = nodes (2,3,7) + 1
= 3 + 1 = 4
V(G) = Edges – Nodes + 2 = 14 – 12 + 2 = 4
atau = 12 – 10 + 2 = 4
3. diketahui PDL mencetak bintang, sbb :
START
int bintang, i, j;
1 char Lagi;
DO
2 INPUT “bintang”;
3 FOR (i=1;i<=bintang;i++)
4 FOR (j=1;j<=bintang-i;j++)
5 CETAK " * ";
6 ENDFOR
7 ENDFOR
8 CETAK “Tekan Y/y untuk mengulang";
INPUT Lagi;
9 WHILE (Lagi =='Y' OR Lagi =='y');
10 END
Buatlah flowgraph dan carilah cyclometic complexity-nya
V(G) = Region = 4
V(G) = Predicates Nodes + 1 = nodes (3,5,9) + 1
= 3 + 1 = 4
V(G) = Edges – Nodes + 2 = 12 – 10 + 2 = 4
Sabtu, 04 April 2009
qUIZ Cyclometic "Testing dan Implementasi" Semester 8
Diposting oleh denis di 22.40
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar