Question

In: Computer Science

The citizens of Javaland require a program that calculates the personal income tax owed by each...

The citizens of Javaland require a program that calculates the personal income tax owed by

each taxpayer.

Write the code for a class method

calculateTaxableIncome

that accepts the following 5

inputs:

General Income

Investment Income

Other Income

Regular Deductions

Other Deductions

The method calculates the amount of a citizen’s taxable income. Taxable income is obtained

by summing all income and subtracting all deductions. Note that only 50% of Other

Deductions are tax deductible.

The signature for this method is:

public static double calculateTaxableIncome(double generalIncome, double

investmentIncome, double otherIncome, double regularDeductions,

double otherDeductions)

Note that all calculated monetary values should be rounded to 2 decimal places.

Write the code for a class method

calculateIncomeTax

that accepts the following input:

Taxable Income. The method calculates the amount of income tax due to the Government of

Javaland based on a citizen’s calculated taxable income. Income tax is calculated as a

percentage of taxable income based on the following rules:

10% on the first $20,000 of taxable income

12% on the next $20,000 of taxable income

15% on the next $20,000 of taxable income

20% on all remaining taxable income

The signature for this method is:

public static double calculateIncomeTax(double taxableIncome)

Comp 122 Assignment 03 page

2

Note that all calculated monetary values should be rounded to 2 decimal places.

Save these methods’ source code in your methods class

Solutions

Expert Solution

SOLUTION-
I have solve the problem in Java code with comments for easy understanding :)

CODE-

//java code

//class

public class incomeTax {

//declaration
double generalIncome;
double InvestmentIncome;
double otherIncome;
double regularDeductions;
double otherDeductions;


   public double getGeneralIncome() {
   return generalIncome;
}


public void setGeneralIncome(double generalIncome) {
   this.generalIncome = generalIncome;
}


public double getInvetmentIncome() {
   return InvestmentIncome;
}


public void setInvestmentIncome(double investmentIncome) {
   InvestmentIncome = investmentIncome;
}


public double getOtherIncome() {
   return otherIncome;
}


public void setOtherIncome(double otherIncome) {
   this.otherIncome = otherIncome;
}


public double getRegularDeductions() {
   return regularDeductions;
}


public void setRegularDeductions(double regularDeductions) {
   this.regularDeductions = regularDeductions;
}


public double getOtherDeductions() {
   return otherDeductions;
}


public void setOtherDeductions(double otherDeductions) {
   this.otherDeductions = otherDeductions;
}


   public incomeTax(double generalIncome, double investmentIncome, double otherIncome, double regularDeductions,
       double otherDeductions) {
   super();
   this.generalIncome = generalIncome;
   InvestmentIncome = investmentIncome;
   this.otherIncome = otherIncome;
   this.regularDeductions = regularDeductions;
   this.otherDeductions = otherDeductions;
}

public static double calculateTaxableIncome(double generalIncome, double investmentIncome, double otherIncome, double regularDeductions,
       double otherDeductions)
       {
   return generalIncome+investmentIncome+otherIncome-regularDeductions-(0.5*otherDeductions);
       }

   @Override
public String toString() {
   return "incomeTax [generalIncome=" + generalIncome + ", InvestmentIncome=" + InvestmentIncome + ", otherIncome="
           + otherIncome + ", regularDeductions=" + regularDeductions + ", otherDeductions=" + otherDeductions
           + ", getGeneralIncome()=" + getGeneralIncome() + ", getInvetmentIncome()=" + getInvetmentIncome()
           + ", getOtherIncome()=" + getOtherIncome() + ", getRegularDeductions()=" + getRegularDeductions()
           + ", getOtherDeductions()=" + getOtherDeductions() + "]";
}


   public static void main(String[] args) {
       // TODO Auto-generated method stub

       incomeTax I =new incomeTax(5400,7800,8000,4500,5300);
       double taxableIncome=I.calculateTaxableIncome(5400,7800,8000,4500,5300);
       double incometax;
       if (taxableIncome<=20000)
           incometax=10*taxableIncome/100;
       else if(taxableIncome>=20000 && taxableIncome<=40000)
           incometax=20*taxableIncome/100;
       else if(taxableIncome>=40000 && taxableIncome<=60000)
           incometax=15*taxableIncome/100;
       else
           incometax=20*taxableIncome/100;
       System.out.println(I.toString());
       System.out.println("Income taax to be paaid to the government is "+incometax);
   }

}

OUTPUT:
incomeTax [generalIncome=5400.0, InvestmentIncome=7800.0, otherIncome=8000.0, regularDeductions=4500.0, otherDeductions=5300.0, getGeneralIncome()=5400.0, getInvetmentIncome()=7800.0, getOtherIncome()=8000.0, getRegularDeductions()=4500.0, getOtherDeductions()=5300.0]
Income taax to be paaid to the government is 1405.0

IF YOU HAVE ANY DOUBT PLEASE COMMENT DOWN BELOW I WILL SOLVE IT FOR YOU:)
----------------PLEASE RATE THE ANSWER-----------THANK YOU!!!!!!!!----------


Related Solutions

Marginal Tax rate Earnings/Income Tax owed 10% $0 to $9,525 10% of income 12% $9,526 to...
Marginal Tax rate Earnings/Income Tax owed 10% $0 to $9,525 10% of income 12% $9,526 to $38,700 $952.50 plus 12% of the amount over $9,525 22% $38,701 to $82,500 $4,453.50 plus 22% of the amount over $38,700 24% $82,501 to $157,500 $14,089.50 plus 24% of the amount over $82,500 32% $157,501 to $200,000 $32,089.50 plus 32% of the amount over $157,500 35% $200,001 to $500,000 $45,689.50 plus 35% of the amount over $200,000 37% $500,001 or more $150,689.50 plus 37%...
Income tax rates schedule “ (1) for the Personal Income Tax Net income which does not...
Income tax rates schedule “ (1) for the Personal Income Tax Net income which does not exceed 300,000 baht 5 percent Net income which only the amount in excess of    300,000 baht but not exceeding    500,000 baht 10 percent Net income which only the amount in excess of    500,000 baht but not exceeding    750,000 baht    15 percent Net income which only the amount in excess of    750,000 baht   but not exceeding 1,000,000 baht   20 percent Net income which only the...
Consider a government that imposes a personal income tax. It is estimated that the tax will...
Consider a government that imposes a personal income tax. It is estimated that the tax will not affect total labour supplied in the economy. Given this, the political party advocating for the tax argue that the tax acts as a non-distortionary, lump-sum tax, and as such imposes no excess burden. Is this a reasonable argument?
Consider a government that imposes a personal income tax. It is estimated that the tax will...
Consider a government that imposes a personal income tax. It is estimated that the tax will not affect total labour supplied in the economy. Given this, the political party advocating for the tax argue that the tax acts as a non-distortionary, lump-sum tax, and as such imposes no excess burden. Is this a reasonable argument?
Calculates the tax benefits of switching the business to a s corporation for each of the...
Calculates the tax benefits of switching the business to a s corporation for each of the stakeholders involved and the business entity For a s corporation lets say the company Is worth $100 million dollars and $17.5 million in revenue. Bob owns 50% of the company Mark owns 20% of the company Tony owns 25% but his selling his portion of the company Steve owns 5 % tax benefits of switching the business to a s corporation?
For each of the following independent circumstances calculate both the FUTA and SUTA tax owed by...
For each of the following independent circumstances calculate both the FUTA and SUTA tax owed by the employer: NOTE: For simplicity, all calculations throughout this exercise, both intermediate and final, should be rounded to two decimal places at each calculation. 1:An employer in The U.S. Virgin Islands employs two individuals, whose taxable earnings to date (prior to the current pay period) are $5,100 and $6,900. During the current pay period, these employees earn $1,650 and $2,800, respectively. The applicable SUTA...
The personal income tax, corporate income tax, and contributions to social insurance (Medicare and Social Security)...
The personal income tax, corporate income tax, and contributions to social insurance (Medicare and Social Security) together makes up approximately ______ of all federal government tax revenues annually (based on annual data from the period 2010-2015.) A. 95% B. 65% C. 45% D. 15% E. 4.5%
IN JAVA Write a program that calculates the occupancy rate for each floor of a hotel....
IN JAVA Write a program that calculates the occupancy rate for each floor of a hotel. (Use a sentinel value and please point out the sentinel in bold.) The program should start by asking for the number of floors in the hotel. A loop should then iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor and the number of them that are occupied. After all the iterations,...
Write a program that calculates the occupancy rate for each floor of a hotel. (Use a...
Write a program that calculates the occupancy rate for each floor of a hotel. (Use a sentinel value and please point out the sentinel in bold.) The program should start by asking for the number of floors in the hotel. A loop should then iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor and the number of them that are occupied. After all the iterations, the program...
The basic premise of the U.S. income tax system is that U.S. citizens, resident aliens and...
The basic premise of the U.S. income tax system is that U.S. citizens, resident aliens and corporations are subject to tax on worldwide income regardless of the country from which the income derives. The Tax Cuts and Jobs Act of 2017 essentially moved the U.S. towards a hybrid “Worldwide Tax System” to a “Territorial Basis Tax System.” Briefly explain the “old system” and then describe some of the most salient provisions which characterize a “Territorial System.” Provide explanations, analysis and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT