Tugas 10.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; // Muhammad irfan Zidni // 3420230014 // Tekhnik Informatika //Function NOT Return Value (Without Parameter) void garis() { puts("--------------------------------------"); } //Function NOT Return Value (With Parameter) void ttd(string nama, string email) { garis(); cout<<"Nama : "<<nama<<endl; cout<<"Email : "<<email<<endl; } //Function Return Value (Without Parameter) string judul() { return "Program Perhitungan Jasa dan Komisi"; } void ketentuan() { cout<<"\n\nKETENTUAN"<<endl; garis(); cout<<"| Pendapatan | Jasa | Komisi |"<<endl; garis(); cout<<"| <=200.000 | 10 rb | 10 Persen |"<<endl; cout<<"| <=500.000 | 20 rb | 15 Persen |"<<endl; cout<<"| > 500.000 | 30 rb | 20 Persen |"<<endl; garis(); puts("Harus Terdapat Function NOT Return Value (Without Parameter)"); puts("Harus Terdapat Function NOT Return Value (With Parameter)"); puts("Harus Terdapat Function Return Value (With Parameter)"); puts("Harus Terdapat Function Return Value (Without Parameter)"); puts("Harus Terdapat Struktur IF"); garis(); } //Function Return Value (With Parameter) long cek_jasa(long pendapatan) { long jasa; //Struktur IF if (pendapatan <= 200000) { jasa = 10000; } else if(pendapatan <= 500000) { jasa = 20000; } else { jasa = 30000; } return jasa; } long cek_komisi(long pendapatan) { long komisi; if (pendapatan <= 200000) { komisi = (10*pendapatan)/100; } else if(pendapatan <= 500000) { komisi = (15*pendapatan)/100; } else { komisi = (20*pendapatan)/100; } return komisi; } int main() { garis(); cout<<judul()<<endl; garis(); long pendapatan, jasa, komisi, total; printf("Pendapatan hari ini Rp. <input>"); cin>>pendapatan; cout<<endl; ketentuan(); jasa = cek_jasa(pendapatan); komisi = cek_komisi(pendapatan); /*Proses Perhitungan*/ total = pendapatan + jasa + komisi; printf("Uang jasa Rp.%d\n", jasa); printf("Uang komisi Rp.%d\n", komisi); garis(); printf("Hasil total adalah Rp.%d\n\n",total); ttd("Irfan","muhammadirfanzidni801@gmail.com"); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines