Sei sulla pagina 1di 12

Algoritma dan Diagram Alir

Algoritma (algortihm) adalah :

- a process or set of rules to be followed in calculations or other problem-


solving operations, especially by a computer.
(https://dictionary.cambridge.org/dictionary/english/algorithm)

- An algorithm is a step by step method of solving a problem. It is


commonly used for data processing, calculation and other related
computer and mathematical operations.
- An algorithm is also used to manipulate data in various ways, such as
inserting a new data item, searching for a particular item or sorting an
item. (https://www.techopedia.com/definition/3739/algorithm)

- is a set of instructions, typically to solve a class of problems or perform


a computation. Algorithms are unambiguous specifications for
performing calculation, data processing, automated reasoning, and
other tasks. (https://en.wikipedia.org/wiki/Algorithm)

Diagram Alir (Flow Chart) :

- a diagram of the sequence of movements or actions of people or things


involved in a complex system or activity.
- a graphical representation of a computer program in relation to its
sequence of functions (as distinct from the data it processes).
(https://www.google.com/search?ei=mN8WXZxzwvm8BMX6nMgD&q=fl
ow+chart+meaning&oq=flow+chart+meaning&gs_l=psy-
ab.3..0i7i30l9j0i203.361630.365820..369501...0.0..1.382.1775.1j6j1j2.....
.0....1..gws-wiz.......0i71j0i7i10i30.yBoju5EmFeo)

- A flowchart is a type of diagram that represents a workflow or process.


A flowchart can also be defined as a diagrammatic representation of
an algorithm, a step-by-step approach to solving a task.
(https://en.wikipedia.org/wiki/Flowchart)
- A flow chart is a graphical or symbolic representation of a process. Each
step in the process is represented by a different symbol and contains a
short description of the process step. The flow chart symbols are linked
together with arrows showing the process flow direction.
(https://www.breezetree.com/articles/what-is-a-flow-chart)

- A flowchart is a formalized graphic representation of a logic sequence,


work or manufacturing process, organization chart, or similar formalized
structure. The purpose of a flow chart is to provide people with a
common language or reference point when dealing with a project or
process.( https://whatis.techtarget.com/definition/flowchart)
1. Menghitung rata-rata Nilai

Algoritma :
- Ambil nilai Tugas
- Ambil nilai UTS
- Ambil nilai UAS
- Hitung rerata
- Tampilan hasil
Diagram Alir :

Mulai

Harian =
UTS =
UAS =

Rerata = Harian+UTS+UAS/3

Rerata =

Ya
Lagi?

tdk
Selesai

2. Konversi Sudut

Algoritma :
- Masukan/ Ambil data sudut
- Hitung harga perbandingan sudut Sinus
- Tampilkan hasil
- Hitung harga perbandingan sudut Cosinus
- Tampilkan hasil
- Hitung harga perbandingan sudut Tangent
- Tampilkan hasil

Diagram Alir :

Mulai

Sudut =

S = Sin(sudut * 3.14 / 180) S =

C = Cos(sudut * 3.14 / 180) C=

T = Sin(sudut * 3.14 / 180) T =

Ya
Lagi?

tdk
Selesai
Susun Algoritma dan Diagram alirnya:
3. Menghitung tebal cavity

Private Sub Command1_Click()


Dim P, L, Pa, Pclamps, SF, ncavity, Tcavity As Single
P = Val(panjang.Text)
L = Val(lebar.Text)
SF = 5
ncavity = 2
Pa = ((P * L) * 2 + 1.5)
Pclamps = ((Pa * (14.065279 / 5)) / 1000)
Tcavity = ((Pclamps * SF) / (720 * ncavity))
Text6 = Val(Tcavity)
End Sub

Private Sub Command10_Click()


End
End Sub

Private Sub Command3_Click()


Dim P, L, T, W, I, E, Dol As Single
P = Val(panjang.Text)
L = Val(lebar.Text)
T = Val(tinggi.Text)
W = (P * T * 20000)
E = (30 * 10 ^ 6)
I = (10000 * W * 5 ^ 3) / (192 * 30 * 10 ^ 6)
Dol = ((W * L) / 192 * E * I) * (3 * (P * 2) ^ 2 - 4 * P)
Text8 = Val(Dol)
End Sub

Private Sub Command4_Click()


Dim P, L, T, W, I, E, Doc As Single
P = Val(panjang.Text)
L = Val(lebar.Text)
T = Val(tinggi.Text)
W = (P * T * 20000)
E = (30 * 10 ^ 6)
I = (10000 * W * 5 ^ 3) / (192 * 30 * 10 ^ 6)
Doc = (W * L) / 192 * E * I * (3 * P * 2 - 4 * P ^ 2)
Text9 = Val(Doc)
End Sub

Private Sub Command5_Click()


Dim P, L, Ltot As Single
P = Val(panjang.Text)
L = Val(lebar.Text)
Ltot = (P * L) * 2
Text10 = Val(Ltot)
End Sub
Private Sub Command6_Click()
Dim P, L, Pa, Pclamps As Single
P = Val(panjang.Text)
L = Val(lebar.Text)
Pa = ((P * L) * 2 + 1.5)
Pclamps = ((Pa * (14.065279 / 5)) / 1000)
Text11 = Val(Pclamps)
End Sub

Private Sub Command7_Click()


Dim aoc As Single
aoc = ((200 / 5) / 2)
Text12 = Val(aoc)
End Sub

Private Sub Command8_Click()


Dim P, foc As Single
P = Val(panjang.Text)
foc = ((P - (P - 2.7051)) / 2)
Text13 = Val(foc)
End Sub

Private Sub Command9_Click()


panjang.Text = ""
tinggi.Text = ""
lebar.Text = ""
sprue.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
panjang.SetFocus
End Sub

4. Menghitung Keliling Luas Volume

Private Sub Command1_Click()


Dim p, l, t, a As Single
p = Val(Panjang.Text)
l = Val(Lebar.Text)
t = Val(Tinggi.Text)
k = Val((4 * Panjang) + (4 * Lebar) + (4 * Tinggi))
Keliling.Text = k
End Sub

Private Sub Command2_Click()


Dim p, l, t, a As Single
p = Val(Panjang.Text)
l = Val(Lebar.Text)
t = Val(Tinggi.Text)
a = Val(2 * (Panjang * Lebar + Lebar * Tinggi + Tinggi * Panjang))
Luas.Text = a
End Sub
Private Sub Command3_Click()
Dim p, l, t, v As Single
p = Val(Panjang.Text)
i = Val(Lebar.Text)
t = Val(Tinggi.Text)
v = Val(Panjang * Lebar * Tinggi)
Volume.Text = v
End Sub

Private Sub Command4_Click()


Panjang.Text = ""
Lebar.Text = ""
Tinggi.Text = ""
Keliling.Text = ""
Luas.Text = ""
Volume.Text = ""
Lebar.SetFocus
End Sub

Private Sub Command5_Click()


End
End Sub

5. Menu Luas Volum

Private Sub Command1_Click()


Form2.Text1 = Text1.Text
Form2.Show
End Sub

Dim p, x As Integer
d = Val(Form2.Text4)
x = Val(1 / 4 * 3.14 * (d * d))
lk = x

End Sub

Private Sub Command4_Click()


Form1.Show
Form3.Hide
End Sub

Private Sub Text1_Change()


Text3.Form2

End Sub

Private Sub Command1_Click()


Dim p, x As Integer
p = Val(Form2.Text3)
x = Val(p * p * p)
kb = x

End Sub

Private Sub Command2_Click()


Dim p, x As Integer
p = Val(Form2.Text3)
l = Val(Form2.Text2)
t = Val(Form2.Text1)
x = Val(p * l * t)
blk = x

End Sub
Private Sub Command3_Click()
Dim p, x As Integer
d = Val(Form2.Text4)
t = Val(Form2.Text1)
x = Val(1 / 4 * 3.14 * (d * d) * t)
sl = x

End Sub

Private Sub Command4_Click()


Form1.Show
Form4.Hide

End Sub

Potrebbero piacerti anche