Вы находитесь на странице: 1из 17

TUGAS TESTING DAN

IMPLEMENTASI

NIM : 2015142011
Nama : MOHAMAD RIFALDI
Kelas : TI-SE 1/5
2. Read (a) 3. a5
If a>3 then while a <10 do
a2 a a+1
Endif EndWhile
Write (a)
a a+ 10
Write (a)

4. Read (a) 5. Read(a,b)


For a5 to 10 do if (a>b)
Write (a) then maksa
Endfor Endif
if a<15 write (maks)
then a a+3 write (a,b)
endif
write (a)
6. Read (a,b) 7. Read(a,b,c)
If a>3 OR b <=10 if (a>b) AND (a >c)
then a 2 then maksa
else b a+b
else if (b>c)
Endif
Write (a,b) then maks b
else maks c
8. var a, b,c : integer; Endif
begin Endif
readln(a,b) write (maks)
case a of if a<0
1: if a>b then then write (negatif)
writeln(a)
endif
2:if a<b then
writeln(b)
write (a,b,c)
end
c=a+b
Writeln (a,b,c)
2. Read (a)
NO. 2 If a>3 then
a2
Endif
Write (a)
Node (N) = 5

Edge (E) = 5

Region = 2

Jalur Independent =
1-2-3-4-5
1-2-4-5
p=1

CC = Jumlah Region = 2
CC = E N + 2 = 5 5 + 2 = 2
V(g) = p + 1 = 1 + 1 = 2

Test Case

Input Output
------------------------------------
a=4 a=2
a=2 2
NO. 3 3. a5
while a <10 do
a a+1
EndWhile
a a+ 10
Write (a)
Node (N) = 6

Edge (E) = 6

Region = 2

Jalur Independent =
1-2-3-2-4-5-6
1-2-4-5-6
p=1

CC = Jumlah Region = 2
CC = E N + 2 = 6 6 + 2 = 2
V(g) = p + 1 = 1 + 1 = 2

Test Case

Input Output
------------------------------------
a=4 a=4+1
a=11 a=11+10
NO. 4 4. Read (a)
For a5 to 10 do
Write (a)
Endfor
if a<15
then a a+3
endif
write (a)
Node (N) = 8

Edge (E) = 9

Region = 3

Jalur Independent =
1-2-3-4-1-2-5-6-7-8
1-2-5-6-7-8
1-2-5-7-8
p=2

CC = Jumlah Region = 3
CC = E N + 2 = 9 8 + 2 = 2
V(g) = p + 1 = 2 + 1 = 3

Test Case

Input Output
------------------------------------
a=5 5
a=11 a=11+3
a=16 16
NO. 5 5. Read(a,b)
if (a>b)
then maksa
Endif
write (maks)
write (a,b)
Node (N) = 6

Edge (E) = 6

Region = 2

Jalur Independent =
1-2-3-2-4-5-6
1-2-4-5-6
p=1

CC = Jumlah Region = 2
CC = E N + 2 = 6 6 + 2 = 2
V(g) = p + 1 = 1 + 1 = 2

Test Case

Input Output
------------------------------------
maks=0 maks=0
a>b maks=a
a<b maks=0
6. Read (a,b)
NO. 6 If a>3 OR b <=10
then a 2
else b a+b
Endif
Write (a,b)
Node (N) = 6

Edge (E) = 6

Region = 2

Jalur Independent =
1-2-3-5-6
1-2-4-5-6
p=1

CC = Jumlah Region = 2
CC = E N + 2 = 6 6 + 2 = 2
V(g) = p + 1 = 1 + 1 = 2

Test Case

Input Output
------------------------------------
a=4 a=2
b=6 a=2
a=2 b = 2+b
b = 11 b = a+11
NO. 7 7. Read(a,b,c)
if (a>b) AND (a >c)
then maksa
else if (b>c)
then maks b
else maks c
Endif
Endif
write (maks)
if a<0
then write (negatif)
endif

write (a,b,c)
Node (N) = 12

Edge (E) = 14

Region = 4

Jalur Independent =
1-2-3-7-8-9-11-12
1-2-3-7-8-9-10-11-12
1-2-4-5-7-8-9-10-11-12
1-2-4-6-7-8-9-11-12
p=3

CC = Jumlah Region = 4
CC = E N + 2 = 14 12 + 2 = 4
V(g) = p + 1 = 3 + 1 = 4
Test Case

Input Output
------------------------------------
a > b && a > c maks=a
b>c maks=b
c>b maks=c
a=0 negatif
NO. 8 8. var a, b,c : integer;
begin
readln(a,b)
case a of
1: if a>b then
writeln(a)
2:if a<b then
writeln(b)
end
c=a+b
Writeln (a,b,c)
End
Node (N) = 9

Edge (E) = 11

Region = 4

Jalur Independent =
1-2-3-5-7-8-9
1-2-3-7-8-9
1-2-4-6-7-8-9
1-2-4-7-8-9
p=3

CC = Jumlah Region = 4
CC = E N + 2 = 11 9 + 2 = 4
V(g) = p + 1 = 3 + 1 = 4

Test Case

Input Output
------------------------------------
a>b a
a<b b