Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <conio.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <sstream>
- using namespace std;
- void satuan (int a)
- {
- if (a==1) {cout<<" Satu ";}
- else if (a==2) {cout<<" Dua ";}
- else if (a==3) {cout<<" Tiga ";}
- else if (a==4) {cout<<" Empat ";}
- else if (a==5) {cout<<" Lima ";}
- else if (a==6) {cout<<" Enam ";}
- else if (a==7) {cout<<" Tujuh ";}
- else if (a==8) {cout<<" Delapan ";}
- else if (a==9) {cout<<" Sembilan ";}
- else if (a==10) {cout<<" Sepuluh ";}
- else if (a==11) {cout<<" Sebelas ";}
- }
- void terbilang (long long b)
- {if (b<=11) {satuan(b);}
- else if ((b>11) && (b<=19))
- {
- terbilang(b%10); cout<<"Belas ";
- }
- else if ((b>=20)&&(b<=99))
- {
- terbilang(b/10); cout<<"Puluh "; terbilang(b%10);
- }
- else if ((b>=100)&&(b<=199))
- {
- cout<<"Seratus "; terbilang(b%100);
- }
- else if ((b>=200)&&(b<=999))
- {
- terbilang(b/100); cout<<"Ratus "; terbilang(b%100);
- }
- else if ((b>=1000)&&(b<=1999))
- {
- cout<<"Seribu "; terbilang(b%1000);
- }
- else if ((b>=2000)&&(b<=9999))
- {
- terbilang(b/1000); cout<<"Ribu "; terbilang(b%1000);
- }
- else if ((b>=10000)&&(b<=99999))
- {
- terbilang(b/1000); cout<<"Ribu "; terbilang(b%1000);
- }
- else if ((b>=100000)&&(b<=999999))
- {
- terbilang(b/1000); cout<<"Ribu "; terbilang(b%1000);
- }
- else if ((b>=1000000)&&(b<=999999999))
- {
- terbilang (b/1000000); cout<<"Juta "; terbilang (b%1000000);
- }
- else if ((b>=1000000000)&&(b<=999999999999))
- {
- terbilang (b/1000000000); cout<<"Milyar "; terbilang (b%1000000000);
- }
- else if ((b>=1000000000000))
- cout<<"Maaf ! Angka Yang Anda Masukan Salah!\n\n";
- }
- int main()
- {
- awal:
- cout<<"\t\t +--------------------------------+"<<endl;
- cout<<"\t\t | Politeknik TMKM |"<<endl;
- cout<<"\t\t ---+--> Ulangan Tengah Semester <---+---"<<endl;
- cout<<"\t\t | Algoritma dan Pemograman II |"<<endl;
- cout<<"\t\t +--------------------------------+"<<endl<<endl;
- int pilih_jurusan, semester, total, sks, praktikum, dpp, ukt;
- string nama, ID_jurusan, jurusan,kode_jurusan, id_tahun1, tahun, npm, no_urut, id_semester, kodean, email ;
- cout<<"\t Nama Lengkap\t : ";getline(cin, nama);
- cout<<"\t Email\t\t : ";cin>>email;
- cout<<"\t No Urut\t : ";cin>>no_urut;
- cout<<"\t Jurusan\t : \n\t\t\t\t 1. Teknik Komputer\n\t\t\t\t 2. Teknik Elektronika\n\t\t\t\t 3. Teknik Rekayasa Industri Otomotif\n\t\t\t\t 4. Administrasi Bisnis\n\t\t\t\t 5. Akutansi\n\t\t\t\t 6. Akutansi Perpajakan\n\t\t\t : ";cin>>pilih_jurusan;
- if(pilih_jurusan==1)
- {
- ID_jurusan = "TK";
- jurusan = "Teknik Komputer";
- kode_jurusan = "01";
- }
- else if(pilih_jurusan==2)
- {
- ID_jurusan = "TE";
- jurusan = "Teknik Elektronika";
- kode_jurusan = "02";
- }
- else if(pilih_jurusan==3)
- {
- ID_jurusan = "TRIO";
- jurusan = "Teknik Rekayasa Industri Otomotif";
- kode_jurusan = "03";
- }
- else if(pilih_jurusan==4)
- {
- ID_jurusan = "AB";
- jurusan = "Administrasi Bisnis";
- kode_jurusan = "04";
- }
- else if(pilih_jurusan==5)
- {
- ID_jurusan = "AK";
- jurusan = "Akutansi";
- kode_jurusan = "05";
- }
- else if(pilih_jurusan==6)
- {
- ID_jurusan = "AKP";
- jurusan = "Akutansi Perpajakan";
- kode_jurusan = "06";
- }
- cout<<"\t Semester\t : ";cin>>semester;
- if(semester==1)
- {
- id_semester = "01";
- }
- else if(semester==2)
- {
- id_semester = "02";
- }
- else if(semester==3)
- {
- id_semester = "03";
- }
- else if(semester==4)
- {
- id_semester = "04";
- }
- else if(semester==5)
- {
- id_semester = "05";
- }
- else if(semester==6)
- {
- id_semester = "06";
- } else {
- cout<<"\n\n \t\t Input Dengan Benar";
- system("cls");
- goto awal;
- }
- cout<<"\t Tahun Masuk\t : ";cin>>tahun;
- id_tahun1 = tahun.substr(2,2);
- tagihan:
- cout<<endl<<endl;
- cout<<"\t +---------> POLITEKNIK TMKM <---------"<<endl;
- cout<<"\t | Nama Lengkap\t : "<<nama<<endl;
- cout<<"\t | Semester\t : "<<id_semester<<endl;
- cout<<"\t | Alamat Email\t : "<<email<<endl;
- cout<<"\t | Jurusan\t : "<<jurusan<<endl;
- npm = id_tahun1+"."+kode_jurusan+"."+id_semester+"."+no_urut;
- cout<<"\t | NPM\t\t : "<<npm<<endl;
- cout<<"\t | SKS\t\t : Rp ";cin>>sks;
- cout<<"\t | Praktikum\t : Rp ";cin>>praktikum;
- cout<<"\t | DPP\t\t : Rp ";cin>>dpp;
- cout<<"\t | UKT\t\t : Rp ";cin>>ukt;
- total = sks+praktikum+dpp+ukt;
- if(total>10000)
- {
- cout<<"\n\n\t Total Melebihi Batas Maksimum yg ditentukan,";
- getche();
- goto tagihan;
- }
- cout<<"\t | TOTAL\t : Rp "<<total<<endl;
- cout<<"\t | TERBILANG\t :";
- stringstream id_tot;
- id_tot<<total;
- string s;
- id_tot>>s;
- terbilang(total);
- kodean = no_urut+"."+ID_jurusan+"."+tahun+"."+s;
- cout<<endl;
- cout<<"\t | Kode Tagihan\t : "<<kodean<<endl;
- cout<<"\t +---------> POLITEKNIK TMKM <---------"<<endl<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement