Jumat, 26 Januari 2018

PROGRAM MENCARI NILAI RATA-RATA DAN GAJIH PEGAWAI






jawaban :

CLS
FOR I = 1 TO 10
    INPUT "Nama"; nama$(I)
    INPUT " AP-1A "; AAl(I)
    INPUT " AP-1B "; BBl(I)
    INPUT " AP-1C "; CCl(I)
NEXT I
CLS

PRINT TAB(15); "DAFTAR NILAI ALGORITMA DAN PEMOGRAMAN 1 "
PRINT TAB(17); "MAHASISWA UNIVERSITAS GUNADARM "
PRINT ""
PRINT "-------------------------------------------------------------------------------"
PRINT TAB(35); "Nilai "
PRINT "-------------------------------------------------------------------------------"
PRINT TAB(1); "No"; TAB(5); "NAMA "; TAB(22); " AP-1A"; TAB(35); " AP-1B"; TAB(50); " AP-1C"; TAB(65); "RATA-RATA"
PRINT "-------------------------------------------------------------------------------"
FOR I = 1 TO 10
    rata = (AAl(I) + BBl(I) + CCl(I)) / 3
    PRINT TAB(1); (I); TAB(5); nama$(I); TAB(22); AAl(I); TAB(35); BBl(I); TAB(50); CCl(I); TAB(65); rata
NEXT I
PRINT "-------------------------------------------------------------------------------"
END

PROGRAM



output








Jawab 

CLS
FOR I = 1 TO 10
    INPUT "Nama"; nama$(I)
    INPUT "Gol"; gol$(I)
NEXT I
CLS

PRINT TAB(24); "DAFTAR GAJI PEGAWAI  "
PRINT TAB(23); " PT. JARINGAN KOMPUTER  "
PRINT TAB(21); "(BULAN SEPTEMBER 2003) "
PRINT "--------------------------------------------------------------------------------"
PRINT TAB(1); "No"; TAB(5); "NAMA PEGAWAI"; TAB(22); "GOL"; TAB(35); "GAJI POKOK"; TAB(50); "TUNJANGN"; TAB(65); "GAJI BERSINH"
PRINT "--------------------------------------------------------------------------------"
FOR I = 1 TO 10
    SELECT CASE gol$(I)
        CASE "1"
            Gaji(I) = 10000
        CASE "2"
            Gaji(I) = 15000
        CASE "3"
            Gaji(I) = 20000
        CASE ELSE
            Gaji(I) = 0
    END SELECT
    tunjangan = Gaji(I) * 10 / 100
    gaber = Gaji(I) + tunjangan
    no = no + 1
    PRINT TAB(1); no; TAB(5); nama$(I); TAB(22); gol$(I); TAB(35); Gaji(I); TAB(50); tunjangan; TAB(65); gaber
NEXT I
PRINT "---------------------------------------------------------------------------------"
END

program


output

1 komentar: