AlgoritmaTugas10.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; void garis() { puts("--------------------------------------"); } void ttd() { garis(); cout<<"Nama : Irsyad Purbha"<<endl; cout<<"Email : irsyadpurbha.fst@uia.ac.id"<<endl; } void judul() { garis(); cout<<"Program Perhitungan Jasa dan Komisi"<<endl; garis(); } 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(); } int main() { judul(); long pendapatan, jasa, komisi, total; printf("Pendapatan hari ini Rp. <input>"); cin>>pendapatan; cout<<endl; ketentuan(); //Model perhitungan integer if (pendapatan <= 200000) { jasa = 10000; komisi = (10*pendapatan)/100; } else if(pendapatan <= 500000) { jasa = 20000; komisi = (15*pendapatan)/100; } else { jasa = 30000; komisi = (20*pendapatan)/100; } /*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(); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines