Nama : PrasetyoAdiNugroho
Kelas : 1i05
Npm : 55410366
Judul : Program penghitungangajihpegawai (dengan THR)
Listing Program
defpersenthr(yn):
ifyn=='n':
print 'Selesai';
else:
print '+-----------------------+';
print '| GAJI PEGAWAI |';
print '+-----------------------+';
print '';
data=[['23','45','66'],['Agus','Bobby','Cindra'],[2000000,1000000,3000000]];
print 'NIP\tNama\tGaji';
for i in range(0,3):
print str(data[0][i])+'\t'+str(data[1][i])+'\t'+str(data[2][i])+'';
print '';
thr=input('Tambahanthrdalampersen % : ');
print '';
print 'NIP\tNama\tGaji\tTHR\tTotal';
for i in range(0,3):
print str(data[0][i])+'\t'+str(data[1][i])+'\t'+str(data[2][i])+'\t'+str((data[2][i])*thr/100)+'\t'+str((data[2][i]+((data[2][i])*thr/100)))+'';
x=raw_input('\nUlangi program THR (y/n) : ');
persenthr(x);
persenthr('y');
Output