#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double UIT, RentaBruta, deduccion1, deduccion2, TotalRentaNeta;
double impuesto1, impuesto2, impuesto3, impuesto4, impuesto5, total=0;
//Parte I (Bloque Descripcion):
UIT=4400;
cout<<"Ingrese Renta Bruta: ";
cin>>RentaBruta;
cout<<"-----------Descripción-----------"<<endl;
if (RentaBruta*0.2 < 105600)
deduccion1=round(RentaBruta*0.2);
else
deduccion1=105600;
cout<<"Deduccion (20% de la renta Bruta obtenida - Maximo S/ 105,600.00): "<<deduccion1<<endl;
if (RentaBruta-deduccion1 < 30800)
deduccion2=round(RentaBruta-deduccion1);
else
deduccion2=30800;
cout<<"Deduccion de 7 UIT (Hasta el limite del total renta de cuarta categoria): "<<deduccion2<<endl;
TotalRentaNeta=RentaBruta-deduccion1-deduccion2;
// Parte II (Bloque Impuesto total a pagar)
impuesto1=0;
impuesto2=0;
impuesto3=0;
impuesto4=0;
impuesto5=0;
if (TotalRentaNeta!=0)
if (TotalRentaNeta<5*UIT)
impuesto1=round(TotalRentaNeta*0.08);
else if (TotalRentaNeta < 20*UIT){
impuesto1=round(5*UIT*0.08);
impuesto2=round((TotalRentaNeta-5*UIT)*0.14);
total=impuesto1+impuesto2;
}
else if (TotalRentaNeta < 35*UIT){
impuesto1=round(5*UIT*0.08);
impuesto2=round(15*UIT*0.14);
impuesto3=round((TotalRentaNeta-20*UIT)*0.17);
total=impuesto1+impuesto2+impuesto3;
}
else if (TotalRentaNeta < 45*UIT){
impuesto1=round(5*UIT*0.08);
impuesto2=round(15*UIT*0.14);
impuesto3=round(15*UIT*0.17);
impuesto4=round((TotalRentaNeta-35*UIT)*0.20);
total=impuesto1+impuesto2+impuesto3+impuesto4;
}
else{
impuesto1=round(5*UIT*0.08);
impuesto2=round(15*UIT*0.14);
impuesto3=round(15*UIT*0.17);
impuesto4=round(10*UIT*0.20);
impuesto5=round((TotalRentaNeta-45*UIT)*0.30);
total = impuesto1+impuesto2+impuesto3+impuesto4+impuesto5;
}
cout<<"Total Renta Neta de Cuarta Categoria: "<<total<<endl;;
cout<<"------Impuesto total a pagar------"<<endl;
cout<<"Renta disponible:\t\tTasa\t\tImpuesto\n";
cout<<"Pago tramo [0, 5 UIT]\t\t8%\t\t"<<impuesto1<<"\n";
cout<<"Pago tramo <5 UIT, 20 UIT]\t14%\t\t"<<impuesto2<<"\n";
cout<<"Pago tramo <20 UIT, 35 UIT]\t17%\t\t"<<impuesto3<<"\n";
cout<<"Pago tramo <35 UIT, 45 UIT]\t20%\t\t"<<impuesto4<<"\n";
cout<<"Pago superior a 45 UIT\t\t30%\t\t"<<impuesto5<<"\n";
cout<<"El impuesto total es: "<<total<<endl;
return 0;
}