Program Hitung Total Pembayaran dari Penjualan Agen Susu TOKO KELONTONG KERONCONGAN
/**Latihan Bab 4 no3 **/
/** Created by: Ipah Hanifah **/
#include<conio.h>#include<stdio.h>
#include<iostream.h>
main()
{
char nama[20],hadiah[25],grade[2];
float nk,nt,nu,nmk=0,nmt=0,nmu=0,na=0;
cout<<" Nama siswa : ";gets(nama);
cout<<" Nilai keaktifan : ";cin>>nk;
cout<<" Nilai tugas : ";cin>>nt;
cout<<" Nilai ujian : ";cin>>nu;
nmk=nk*0.2;
nmt=nt*0.3;
nmu=nu*0.5;
na=nmk+nmt+nmu;
if (na>=80)
{
strcpy(grade,"A");
}
else if (na>=70)
{
strcpy(grade,"B");
}
else if (na>=59)
{
strcpy(grade,"C");
}
else if (na>=50)
{
strcpy(grade,"D");
}
else
{
strcpy(grade,"E");
}
clrscr();
cout<<" Siswa yang bernama : "<<nama<<endl;
cout<<" Dengan nilai persentasi yang dihasilkan "<<endl<<endl;
cout<<" Nilai keaktifan * 20% : "<<nmk<<endl;
cout<<" Nilai tugas * 30% : "<<nmt<<endl;
cout<<" Nilai ujian * 50% : "<<nmu<<endl<<endl;
cout<<"------------------------------"<<endl;
cout<<" Siswa yang bernama "<<nama<<endl;
cout<<" Memperoleh nilai akhir sebesar : "<<na<<endl;
cout<<" Grade nilai yang di dapat adalah : "<<grade<<endl;
getche();
}
Output
Program Hitung Honor karyawan Kontrak PT. DAMAI DINGIN
/**Latihan Bab 4 no3 **/
/** Created by: Ipah Hanifah **/
# include <stdio.h>
# include <conio.h>
# include <iostream.h>
main()
{
int n,gol,pen,total=0;
float jjk;
char nk[20];
double tgolongan,tpend,a,lembur,pendapatan,gaji;
clrscr();
cout<<" ====================================================="<<endl;
cout<<" Program Hitung Honor Karyawan Kontrak PT.DAMAI DINGIN\n";
cout<<" ====================================================="<<endl<<endl;
cout<<" Nama Karyawan : ";gets(nk);
cout<<" Golongan : ";cin>>gol;
cout<<" Pendidikan(1.SMU 2.D3 3.S1): ";cin>>pen;
cout<<" Jumlah Jam Kerja : ";cin>>jjk;
gaji=700000;
if(gol==1)
tgolongan=0.05*gaji;
else if(gol==2)
tgolongan=0.1*gaji;
else
tgolongan=0.15*gaji;
if(pen==1)
tpend=0.025*gaji;
else if(pen==1)
tpend=0.05*gaji;
else
tpend=0.075*gaji;
if(jjk>=8)
{
a=jjk-8;
lembur=a*2500;
}
else
{
lembur=0;
}
pendapatan=tgolongan+tpend+lembur+gaji;
clrscr();
cout<<" PT. DAMAI DINGIN "<<endl;
cout<<"========================="<<endl;
cout<<endl;
cout<<" Karyawan yang Bernama : " <<nk<<endl;
cout<<" Honor Yang Diterima " <<endl<<endl;
cout<<" Honor Tetap : Rp. " <<gaji<<endl;
cout<<" Tunjangan Jabatan : Rp. " <<tgolongan<<endl ;
cout<<" Tunjangan Pendidikan : Rp. " <<tpend<<endl;
cout<<" Honor Lembur : Rp. " <<lembur<<endl ;
cout<<"----------------------------------------"<<endl;
cout<<" Honor yang Diterima : Rp. " <<pendapatan<<endl;
getche();
}
# include <conio.h>
# include <iostream.h>
main()
{
int n,gol,pen,total=0;
float jjk;
char nk[20];
double tgolongan,tpend,a,lembur,pendapatan,gaji;
clrscr();
cout<<" ====================================================="<<endl;
cout<<" Program Hitung Honor Karyawan Kontrak PT.DAMAI DINGIN\n";
cout<<" ====================================================="<<endl<<endl;
cout<<" Nama Karyawan : ";gets(nk);
cout<<" Golongan : ";cin>>gol;
cout<<" Pendidikan(1.SMU 2.D3 3.S1): ";cin>>pen;
cout<<" Jumlah Jam Kerja : ";cin>>jjk;
gaji=700000;
if(gol==1)
tgolongan=0.05*gaji;
else if(gol==2)
tgolongan=0.1*gaji;
else
tgolongan=0.15*gaji;
if(pen==1)
tpend=0.025*gaji;
else if(pen==1)
tpend=0.05*gaji;
else
tpend=0.075*gaji;
if(jjk>=8)
{
a=jjk-8;
lembur=a*2500;
}
else
{
lembur=0;
}
pendapatan=tgolongan+tpend+lembur+gaji;
clrscr();
cout<<" PT. DAMAI DINGIN "<<endl;
cout<<"========================="<<endl;
cout<<endl;
cout<<" Karyawan yang Bernama : " <<nk<<endl;
cout<<" Honor Yang Diterima " <<endl<<endl;
cout<<" Honor Tetap : Rp. " <<gaji<<endl;
cout<<" Tunjangan Jabatan : Rp. " <<tgolongan<<endl ;
cout<<" Tunjangan Pendidikan : Rp. " <<tpend<<endl;
cout<<" Honor Lembur : Rp. " <<lembur<<endl ;
cout<<"----------------------------------------"<<endl;
cout<<" Honor yang Diterima : Rp. " <<pendapatan<<endl;
getche();
}
Output:
No comments:
Post a Comment