#include <iostream.h>
#include <conio.h>
void main(){
int penker, hapet, haper, sisa_pendapatan, totpen;
char kategori_pendapatan;
cout<<"Masukan pendapatan kerja : ";
cin>>penker;
cout<<"Masukan hasil pertanian : ";
cin>>haper;
cout<<"Masukan hasil peternakan : ";
cin>>hapet;
cout<<endl;
totpen = penker+hapet+haper;
sisa_pendapatan=totpen;
cout<<endl;
if ((totpen>5000000)&&(totpen<=6000000)){
sisa_pendapatan=totpen-(0.04*totpen);
}
else if((totpen>6000000)&&(totpen<=7000000)){
sisa_pendapatan=totpen-(0.05*totpen);
}
else if(totpen>7000000){
sisa_pendapatan=totpen-(0.06*totpen);
}
cout<<"--------------------------------------"<<endl;
if((sisa_pendapatan>=1000000)&&(sisa_pendapatan<5000000)){
cout<<"kategori pendapatan : rendah"<<endl;
}
else if((sisa_pendapatan>=5000000)&&(sisa_pendapatan<=6000000)){
cout<<"kategori pendapatan : sedang"<<endl;
}
else if(sisa_pendapatan>6000000){
cout<<"kategori pendapatan : tinggi"<<endl;
}
cout<<"total pendapatan : "<<totpen<<endl;
cout<<"sisa pendapatan : "<<sisa_pendapatan<<endl;
getch();
}
Posting Komentar