2023 Modify the following program to the specifications given below Add a new | Assignment Collections

Computer Science 2023 A+ Work

2023 Modify the following program to the specifications given below Add a new | Assignment Collections

Modify the following program to the specifications given below:

Add a new status – SingleParent – where the tax is computed as a SINGLE but with a further reduction of $5000 per child.

Add a new tax condition – if the income is greater than $249,999 for SINGLE, then add a tax of 25% on income amount above $150,000; if the income is greater than $349,999 for MARRIED, then add a tax of 35% on income amount above $200,000.

Unknown status – if the status doesn’t belong to SINGLE or MARRIED or SINGLE_PARENT, then compute a 33% tax on the income.

 

import java.util.Scanner;

public class TaxReturn

   /**

      Constructs a TaxReturn object for a given income and

      marital status, and computes the tax.

      @param anIncome the taxpayer income

      @param aStatus either SINGLE or MARRIED

   */  

   public TaxReturn(double anIncome, int aStatus)

   { 

      income = anIncome;

      status = aStatus;

   }

 

   public double getTax()

   { 

      double tax = 0;

 

      if (status == SINGLE)

      { 

         if (income <= SINGLE_BRACKET1)

            tax = RATE1 * income;

         else if (income <= SINGLE_BRACKET2)

            tax = RATE1 * SINGLE_BRACKET1

                  + RATE2 * (income – SINGLE_BRACKET1);

         else

            tax = RATE1 * SINGLE_BRACKET1

                  + RATE2 * (SINGLE_BRACKET2 – SINGLE_BRACKET1)

                  + RATE3 * (income – SINGLE_BRACKET2);

      }

      else

      { 

         if (income <= MARRIED_BRACKET1)

            tax = RATE1 * income;

         else if (income <= MARRIED_BRACKET2)

            tax = RATE1 * MARRIED_BRACKET1

                  + RATE2 * (income – MARRIED_BRACKET1);

         else

            tax = RATE1 * MARRIED_BRACKET1

                  + RATE2 * (MARRIED_BRACKET2 – MARRIED_BRACKET1)

                  + RATE3 * (income – MARRIED_BRACKET2);

      }

      return tax;

   }

 

   public static final int SINGLE = 1;

   public static final int MARRIED = 2;

   private static final double RATE1 = 0.15;

   private static final double RATE2 = 0.28;

   private static final double RATE3 = 0.31;

   private static final double SINGLE_BRACKET1 = 21450;

   private static final double SINGLE_BRACKET2 = 51900;

   private static final double MARRIED_BRACKET1 = 35800;

   private static final double MARRIED_BRACKET2 = 86500;

   private double income;

   private int status;

 

   public static void main(String[] args)

   { 

      Scanner in = new Scanner(System.in);

      System.out.print(“Please enter your income: “);

      double income = in.nextDouble();

 

      System.out.print(“Enter S (single) or M (married): “);

      String input = in.next();

      int status = 0;

 

      if (input.equalsIgnoreCase(“S”))

         status = TaxReturn.SINGLE;

      else if (input.equalsIgnoreCase(“M”))

         status = TaxReturn.MARRIED;

      else

      {

         System.out.println(“Bad input.”);

         return;

      }     

      TaxReturn aTaxReturn = new TaxReturn(income, status);

      System.out.println(“The tax is ” + aTaxReturn.getTax());

   }

}

 

 

 

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational