1) Analisa Masalah Dalam matematika pernyataan/argument harus dapat dibuktikan benar dengan bukti (prof). 2) Flowchart Start
Input(n)
For i=1 to n
Total=Total+i
Write(Total)
End
3) Algoritma Algoritma induksi_matematik Deklarasi Total, i, n : Float Deskripsi Read(n) For i 1 to n do Total = Total +i Endfor Write (Total) 4) Source Code Program a. Bahasa C #include <stdio.h> #include
void main (){ clrscr(); float i,n, Total=0; printf ("Jumlah elemen ? "); scanf("%f",&n); for (i=1; i<=n; i++){ Total =Total+i; } printf ("Total = %g ",Total); getche(); } b. Visual Basic • Form1 Option Explicit Private Sub Command1_Click() angka = Val(Text1.Text) jumlah = mat(angka) Label3.Caption = jumlah End Sub Private Sub Command2_Click() angka = Val(Text1.Text) Total = 0 deduksi angka, Total Label3.Caption = Total End Sub
Private Sub Command3_Click() Animasi Unload Form1 End Sub •
Modul o Animation.bas Option Explicit Sub Animasi() Dim A As Long Dim J As Long A = Form1.ScaleHeight J = Form1.ScaleWidth
While Not A = 0 Form1.Height = Form1.Height - 25 A=A-1 Wend While Not J = 0 Form1.Width = Form1.Width - 25 J=J-1 Wend End Sub o VbLat.bas Option Explicit Public angka, I Public jumlah As Long Public Total As Long Sub deduksi(n, Total) For I = 1 To n Total = Total + I Next I End Sub Function mat(n) As Long Total = 0 For I = 0 To n Total = Total + I Next I mat = Total End Function c. PHP • Induksi.php <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> Induksi Matematik
echo ("Total semuanya = $total"); ?>
•
Form.htm <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> Form Masukan
5) Tes Program ♦ C/C++ Tes program dengan nilai n = 50
♦ Visual Basic Tes program dengan nilai n = 50
♦ PHP Tampilan isian form dengan nilai 10
Tampilan hasil perhitungan pada induksi.php