Dev - C++ - Como hacer esto en c++?

 
Vista:

Como hacer esto en c++?

Publicado por Jose (6 intervenciones) el 03/02/2018 15:36:52
computeTax ()
Para determinar la carga tributaria, es necesario proyectar los ingresos mensuales a los ingresos anuales, calcular el impuesto y reducir ese monto a un monto mensual. En cada caso, es necesario determinar la categoría impositiva del individuo y luego aplicar la fórmula apropiada. Los tramos impositivos para el año 2006 son:

If taxable income is over-- But not over-- The tax is:
$0 $15,100 10% of the amount over $0
$15,100 $61,300 $1,510.00 plus 15% of the amount over 15,100
$61,300 $123,700 $8,440.00 plus 25% of the amount over 61,300
$123,700 $188,450 $24,040.00 plus 28% of the amount over 123,700
$188,450 $336,550 $42,170.00 plus 33% of the amount over 188,450
$336,550 no limit $91,043.00 plus 35% of the amount over 336,550
The pseudocode for computeTax() is the following:

computeTax (monthlyIncome)
yearlyIncome ← monthlyIncome * 12

if ($0 ≤ yearlyIncome < $15,100)
yearlyTax ← yearlyIncome * 0.10
if ($15,100 ≤ yearlyIncome < $61,300)
yearlyTax ← $1,510 + 0.15 *(yearlyIncome - $15,100)
if ($61,300 ≤ yearlyIncome < $123,700)
yearlyTax ← $8,440 + 0.25 *(yearlyIncome - $61,300)
if ($123,700 ≤ yearlyIncome < $188,450)
yearlyTax ← $24,040 + 0.28 *(yearlyIncome - $123,700)
if ($188,450 ≤ yearlyIncome < $336,550)
yearlyTax ← $42,170 + 0.33 *(yearlyIncome - $188,450)
if ($336,550 ≤ yearlyIncome)
yearlyTax ← $91,043 + 0.35 *(yearlyIncome - $336,550)

monthlyTax ← yearlyTax / 12

return monthlyTax
end
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder