Skip to content

Instantly share code, notes, and snippets.

@mochadwi
Last active November 14, 2016 02:16
Show Gist options
  • Save mochadwi/ce899060e56a0ca6a77a9f02bc0115e5 to your computer and use it in GitHub Desktop.
Save mochadwi/ce899060e56a0ca6a77a9f02bc0115e5 to your computer and use it in GitHub Desktop.
Algoritma Pemilihan (Selection) - Pseudocode N Kasus
{ Judul }
  Menentukan_indeks_nilai

{ Kamus }
  nilai: Real
  indeks: Char

{ Algoritma }
  Input(nilai);

  { Pemilihan - N Kasus dengan Kasus N - 1 }
  If nilai > 80 Then
    indeks <- 'A'
  ElseIf nilai > 70 Then
    indeks <- 'B'
  ElseIf nilai > 60 Then
    indeks <- 'C'
  ElseIf nilai > 40 Then
    indeks <- 'D'
  Else
    indeks <- 'E'

  Output(indeks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment