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

(Financial application: print a tax table ) Listing 3.6gives a program to comput

ID: 3660535 • Letter: #

Question

(Financial application: print a tax table ) Listing 3.6gives a program to compute tax. Write a method for computing tax using the following header: public static doublecomputetax( intstatus, doubletaxableIncome) Use this method to write a program that prints a tax table for taxable income from $50,000 to $60,000 with intervals of $50 for all the following statuses:

Taxable Single Married Joint Married Head of Income or Qualifying Separate a House Widow(er)

50000 8688 6665 8688 7352

50050 8700 6673 8700 7365 ...

59950 11175 8158 11175 9840

60000 11188 8165 11188 9852

Explanation / Answer

import java.util.LinkedHashSet; import java.util.Set; public class Test1 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String string = "aabbccdefatafaz"; int maxValue=0; String letter=null; char[] chars = string.toCharArray(); Set charSet = new LinkedHashSet(); for (char c : chars) { charSet.add(c); } StringBuilder sb = new StringBuilder(); for (Character character : charSet) { sb.append(character); } System.out.println(sb.toString()); String finalStirng = sb.toString(); char[] finalChar = finalStirng.toCharArray(); for(int i=0;imaxValue){ maxValue=count; char lett = finalStirng.charAt(i); letter = String.valueOf(lett); } } System.out.println("Max occured letter is = "+letter+"No.of Times "+maxValue); } }