Giter VIP home page Giter VIP logo

labpratikum5.02's Introduction

LabPratikum5.02

  • print("==================================================================")
    print("|                    PROGRAM INPUT NILAI MAHASISWA               |")
    print("==================================================================")
    
    nilai = []
    perulangan = True
    
    while perulangan:
    nama = input("Masukkan Nama: ")
    nim = input("Masukkan NIM: ")
    nilaiTugas = int(input("Masukkan Nilai Tugas: "))
    nilaiUts = int(input("Masukkan Nilai UTS: "))
    nilaiUas = int(input("Masukkan Nilai UAS    : "))
    nilaiAkhir = (nilaiTugas * 30/100) + (nilaiUts * 35/100) + (nilaiUas * 35/100)
    
    nilai.append([nama, nim, nilaiTugas, nilaiUts, nilaiUas, int(nilaiAkhir)])
    if (input("Tambah data (y/t)? ") == 't'):
      perulangan = False
    
    print("\n                    DAFTAR NILAI MAHASISWA                      ")
    print("==================================================================")
    print("| No | Nama | NIM | Tugas | UTS | UAS | Akhir |")
    print("==================================================================")
    
    i = 0
    for item in nilai:
    i += 1
    print("| {no:2d} | {nama:12s} | {nim:9s} | {nilaiTugas:5d} | {nilaiUts:5d} | {nilaiUas:5d} | {nilaiAkhir:6.2f} |"
       .format(no=i, nama=item[0], nim=item[1], nilaiTugas=item[2], nilaiUts=item[3], nilaiUas=item[4], nilaiAkhir=item[5]))
    print("==================================================================")
    

hasil run

  ==================================================================
  |                    PROGRAM INPUT NILAI MAHASISWA               |
  ==================================================================
  Masukkan Nama: Zahra
  Masukkan NIM: 311242
  Masukkan Nilai Tugas: 32
  Masukkan Nilai UTS: 34
  Masukkan Nilai UAS    : 33
  Tambah data (y/t)? y
  Masukkan Nama: Robi
  Masukkan NIM: 212532
  Masukkan Nilai Tugas: 32
  Masukkan Nilai UTS: 23
  Masukkan Nilai UAS    : 34
  Tambah data (y/t)? y
  Masukkan Nama: Ferdi
  Masukkan NIM: 32135
  Masukkan Nilai Tugas: 33
  Masukkan Nilai UTS: 32
  Masukkan Nilai UAS    : 34
  Tambah data (y/t)? t

                     DAFTAR NILAI MAHASISWA                      
  ==================================================================
  | No | Nama | NIM | Tugas | UTS | UAS | Akhir |
  ==================================================================
  |  1 | Zahra        | 311242    |    32 |    34 |    33 |  33.00 |
  |  2 | Robi         | 212532    |    32 |    23 |    34 |  29.00 |
  |  3 | Ferdi        | 32135     |    33 |    32 |    34 |  33.00 |
  ==================================================================

  Process finished with exit code 0

labpratikum5.02's People

Contributors

aditya-sultan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.