DEV Community

Ari Wira Saputra
Ari Wira Saputra

Posted on

Days_13 Gradebook Builder

Here is a grading scale to help you decide the letter grade the user received (feel free to use a different grading scale if you like.)

Letter Grade Percentage
Image description

class Rank():
  def __init__(self, nama, nilai):
    self.nama = nama
    self.nilai = nilai

  def penentuan(self):
    if self.nilai >= 90 and self.nilai <= 100:
      print(self.nama,"Value A+,CONGRATULATIONS")
    elif self.nilai >= 80 and self.nilai <= 89:
      print(self.nama,"Value A,Bagus. Pertahankan")
    elif self.nilai >= 70 and self.nilai <= 79:
      print(self.nama,"Value B,Tetap semangat")
    elif self.nilai >= 60 and self.nilai <= 69:
      print(self.nama,"Value C,Tingkatkan Lagi")
    elif self.nilai >= 50 and self.nilai <= 59:
      print(self.nama,"Value D,Jangan menyerah")
    else:
      print(self.nama,"Belajar Yang Giat ok!!!!!!!!")

def Masukan(): 
  nama = input("Masukan Nama? ")
  nilai = int(input("Masukan Nilai? "))
  t = Rank(nama,nilai)
  t.penentuan()
Masukan()
Enter fullscreen mode Exit fullscreen mode

Top comments (0)