Posted by Materi Teknik Informatika • Informasi Teknologi Informasi • Digital Marketing on 9/20/2014
/*Program Aplikasi Ujian Praktik TPT*/
/*Keterangan dalam Code Block Linux Ubuntu*/
#include <iostream.h> /*include <iostream>*/
#include <conio.h> /*Tidak digunakan*/
#include <iomanip.h> /*include <ionmanip>*/
#include <stdio.h>
/*using namespace std;*/
void main() /*int main()*/
{
char kode;
cout<<"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"<<endl;
cout<<"* P R O G R A M A P L I K A S I P R A K T I K T P T *"<<endl;
cout<<"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"<<endl;
cout<<"1. Keliling & Luas Lingkaran"<<endl;
cout<<"2. Cek Nilai UNSIKA"<<endl;
cout<<"3. Penggajian PT SUBUR"<<endl;
cout<<"4. Keluar"<<endl;
cout<<"======================================================="<<endl;
cout<<"Masukan Pilihan : ";cin>>kode;
switch (kode)
{
case'1':
clrscr();
int jari;
float luas,keliling;
printf("=================================\n");
printf("Program Keliling & Luas Lingkaran\n");
printf("=================================\n");
printf("Masukan Nilai jari-jari : ");scanf("%d",&jari);
luas=3.14*jari*jari;
keliling=2*3.14*jari;
printf("=================================\n");
printf("Luas Lingkaran : %f\n",luas);
printf("Keliling Lingkaran : %f\n",keliling);
printf("\n");
printf("Copyright by.Septian Maulana 1141177004039");
break;
case'2':
clrscr();
int nilai;
cout<<("========================")<<endl;
cout<<("Program Cek Nilai UNSIKA")<<endl;
cout<<("========================")<<endl;
cout<<("Masukan Nilai : ");cin>>nilai;
cout<<(" ")<<endl;
cout<<"Nilai : "<<nilai;
cout<<(" ");
if (nilai>=85&&nilai<=100)
cout<<("Grade A Termasuk 'Sangat Baik'")<<endl;
else if (nilai>=75&&nilai<=84)
cout<<("Grade B Termasuk 'Baik'")<<endl;
else if (nilai>=60&&nilai<=74)
cout<<("Grade C Termasuk 'Cukup'")<<endl;
else if (nilai>=50&&nilai<=59)
cout<<("Grade D Termasuk 'Kurang'")<<endl;
else if (nilai>=0&&nilai<=49)
cout<<("Grade E Termasuk 'Sangat Kurang'")<<endl;
else
cout<<("Nilai yang anda Inputkan Tidak Valid")<<endl;
cout<<(" ")<<endl;
cout<<("Copyright by.Septian Maulana 1141177004039");
break;
case'3':
clrscr();
char stat;
char nama[20];
int nik;
int gaji;
int kasbon;
int j_anak;
int tunjangan;
int transport;
int g_bersih;
printf("\n");
printf(" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
printf(" PROGRAM SLIP PENGGAJIAN KARYAWAN PT SUBUR\n");
printf(" jln. Niaga No.23 Karawang 41321\n");
printf(" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
printf("\n");
printf(" -=-=Menu Slip Gaji=-=-\n");
printf("\n");
printf(" ====================================================\n");
cout<<(" Nama Karyawan : ");cin.getline(nama,20);
cout<<(" NIK : ");cin>>(nik);
printf(" Jumlah Anak : ");scanf("%d",&j_anak);
printf(" Ada Kendaraan (Y/T) : ");cin>>(stat);
cout<<(" Gaji Pokok : ");cin>>(gaji);
cout<<(" Kasbon : ");cin>>(kasbon);
printf(" ====================================================\n");
//Hitung Tunjangan
if (j_anak>0)
tunjangan=75000;
else
if (j_anak<=0)
tunjangan=0*75000;
//Hitung Transport
if (stat=='Y'||stat=='y')
transport=120000;
else
if (stat=='T'||stat=='t')
transport=0*120000;
//Hitung Total Gaji Bersih
g_bersih=gaji+tunjangan+transport-kasbon;
cout<<(" * Gaji Pokok : Rp.");cout<<(gaji)<<endl;
cout<<(" * Tunjangan : Rp.");cout<<(tunjangan)<<endl;
printf(" * Transport : Rp.%d\n",transport);
printf(" * Kasbon : Rp.%d\n",kasbon);
printf(" ====================================================\n");
printf(" - Gaji Bersih : Rp.%d\n",g_bersih);
break;
case'4':
{
cout<<" "<<endl;
cout<<" TERIMAKASIH TELAH MENGGUNAKAN PROGRAM KAMI"<<endl;
cout<<" "<<endl;
cout<<(" * Copyright by.Septian Maulana 1141177004039");
cout<<" "<<endl;
}
break;
default:
cout<<" *** Maaf Pilihan yang Anda Masukan Salah ***"<<endl;
break;
}
getch(); /*Tidak digunakan*/
}