Jumat, 02 Desember 2011

Latihan soal 3

Soal :
  1. Buatlah tabel deret geometri 4, 12, 36 ........................................................ sampai suku ke 10, berikut jumlah deret tersebut.
  2. Buatlah tabel harmonis 1, 1/2, 1/3 .............................................................. sampai suku ke 10, berikut jumlah deret tersebut.
  3. Buatlah tabel bergoyang 1, -4, 9, -16 .......................................................... sampai suku ke 10, berikut jumlah deret tersebut.
Jawaban :
  1. CLS
    t = 4
    j = 1
    a = 4
    PRINT a;
    10 LET c = a * 3
    PRINT c;
    LET j = j + 1
    t = t + c
    IF j = 10 THEN GOTO 20
    LET a = c
    GOTO 10
    20 PRINT
    PRINT
    PRINT "Jumlah Deret : "; t
    END
  2. CLS
    a = 1
    t = 1
    FOR n = 1 TO 10
    LET b = a / n
    PRINT a; "/"; n; ","; " ";
    LET t = b + t
    NEXT n
    PRINT
    PRINT
    PRINT "Jumlah Deret : "; t
    END
  3. CLS
    a = 0
    t = 0
    FOR n = 1 TO 10
    IF n MOD 2 = 0 THEN LET a = n * n * -1 ELSE LET a = n * n
    t = t + a
    PRINT a;
    NEXT n
    PRINT
    PRINT
    PRINT "Jumalah deret : "; t
    END


     

0 komentar:

Posting Komentar

 
;