Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, I have done the code but it wont print out 25500.00 for the output. I also n

ID: 3800637 • Letter: H

Question

Hi, I have done the code but it wont print out 25500.00 for the output.

I also need a psueocode or whiteboard for this I learned about this in class but don't understand how to make one.

Here is the code to make it easier

import java.util.Scanner;
public class Income {
public static void main(String args[]){
  
   double income;
   double tax;
  
   Scanner input = new Scanner(System.in);
   System.out.print("Input your income:");
   income = input.nextInt();
  

   if(income > 0 && ++income <= 6000){
       tax = income * 0.1;
       System.out.printf("income tax for a single "
               + "perosn making $%.2f is $%.2f%n", income, tax);
   }
   else if(income >= 6001 && ++income <= 27950){
       tax = income * 0.15;
       System.out.printf("income tax for a single "
               + "perosn making $%.2f is $%.2f%n", income, tax);
   }
else if(income >= 27951 && ++income <= 67700){
   tax = income * 0.27;
   System.out.printf("income tax for a single "
           + "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income >= 67701 && ++income <= 141250){
   tax = income * 0.30;
   System.out.printf("income tax for a single "
           + "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income >= 141251 && ++income <= 307050){
   tax = income * 0.35;
   System.out.printf("income tax for a single "
           + "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income > 307050){
   tax = income * (38.6/100);
   System.out.printf("income tax for a single "
           + "perosn making $%.2f is $%.2f%n", income, tax);
   }
else {
       System.out.println("Wrong Input; try again.");
}
}
}

Please focus on the "formatting" of your output. Make sure to prompt the user appropriately and round the output accordingly. 13 Task: Write a program that computes a single filer's income tax burden. TAX RATE Single Filers Income Up to $6000 10% $6,001 $27,950 15% $27,951 $67,700 27% $67,701 $141,250 30% $141,251 $307,050 35% $307, 051 or more 38.6% The user should be able input her Income. If the user enters an income value less than or equal 0, the program should prompt the user and stop. The output can be a simple system.out.printf output Please create a whiteboard or pseduecode process. Attach a Snipping Photo Below Sample Output-//Output should have proper formatting for dollars, 2 decimal place Income tax for a single person making $85000.00 is $25500.00 output 2 Income tax for a single person making $9800.00 is $1470.00

Explanation / Answer

Hi

I have fixed the issue and highlighted the code changes below.

Income.java

import java.util.Scanner;
public class Income {
public static void main(String args[]){
  
double income;
double tax;
  
Scanner input = new Scanner(System.in);
System.out.print("Input your income:");
income = input.nextDouble();
  
if(income > 0 && ++income <= 6000){
tax = income * 0.1;
System.out.printf("income tax for a single "
+ "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income >= 6001 && ++income <= 27950){
tax = income * 0.15;
System.out.printf("income tax for a single "
+ "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income >= 27951 && ++income <= 67700){
tax = income * 0.27;
System.out.printf("income tax for a single "
+ "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income >= 67701 && ++income <= 141250){
tax = income * 0.30;
System.out.printf("income tax for a single "
+ "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income >= 141251 && ++income <= 307050){
tax = income * 0.35;
System.out.printf("income tax for a single "
+ "perosn making $%.2f is $%.2f%n", income, tax);
}
else if(income > 307050){
tax = income * (38.6/100);
System.out.printf("income tax for a single "
+ "perosn making $%.2f is $%.2f%n", income, tax);
}
else {
System.out.println("Wrong Input; try again.");
}
}
}

Output:

Input your income:85000.00
income tax for a single perosn making $85004.00 is $25501.20

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote