Taxes - { tax += total2 * 0.25; } else if (total > 46000...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Taxes { public static void main(String[] args) { double total = 0; double total2 = 0; double added = 0; double tax = 0; double totaltax = 0; do { System.out.print("Enter an amount: "); added = IO.readDouble(); if (added < 0) { return; } total += added; tax = 0; total2 = total; { tax += total2 * 0.1; } else if (total > 8000) { tax += 800; total2 -= 8000; } { tax += total2 * 0.15; } else if (total > 24000 + 8000) { tax += 3600; total2 -= 24000; }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { tax += total2 * 0.25; } else if (total > 46000 + 24000 + 8000) { tax += 11500; total2 -= 46000; } if (total > 46000 + 24000 + 8000 && total <= 86000 + 46000 + 24000 + 8000) { tax += total2 * 0.33; } else if (total > 86000 + 46000 + 24000 + 8000) { tax += 28380; total2 -= 86000; } if (total > 86000 + 46000 + 24000 + 8000) { tax += total2 * 0.35; } tax -= totaltax; IO.outputDoubleAnswer(tax); totaltax += tax; } while (added >= 0); } }...
View Full Document

This note was uploaded on 11/03/2009 for the course CS 01-111 taught by Professor Pradiphari during the Fall '09 term at Rutgers.

Page1 / 2

Taxes - { tax += total2 * 0.25; } else if (total > 46000...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online