question archive Task Write a Java program that will calculate tax for the employees of a company called XYZ

Task Write a Java program that will calculate tax for the employees of a company called XYZ

Subject:Computer SciencePrice: Bought3

Task

Write a Java program that will calculate tax for the employees of a company called XYZ. The main menu of the tax calculation program is as follows.

Welcome to Tax Management System of XYZ

Please select one of the following options:
1. Calculate tax
2. Search tax
3. Exit

When1 is selected then the program will calculate the tax of an employee based on the annual income of the employee and tax rates on the income. The tax rates on the income is stored in a file calledtaxrates.txt. The program needs to read thetaxrates.txt file and store the information in proper data structure. If thetaxrates.txt file does not exist in the directory of the source code then the program should ask to provide thetaxrates.txt file as an input. The format of thetaxrates.txt file is as follows.

Taxable Income

Tax on Income

0 – $18,200

0

$18,201 – $37,000

19c for each $1 over $18,200

$37,001 – $87,000

$3,572 plus 32.5c for each $1 over $37,000

$87,001 – $180,000

$19,822 plus 37c for each $1 over $87,000

$180,001 and over

$54,232 plus 45c for each $1 over $180,000

The program will take user inputs on Employee ID (4-digit number) and the annual income of the employee (floating-point number with two decimal places). Based on the annual income of the employee the program will then calculate the tax (using the information intaxrates.txt file) of the employee. For example, if the annual income of an employee is $100000.00 then the tax of the employee=19822+(100000 - 87000)*0.37= 20303.00.

After calculating the tax of an employee the program will then write the Employee Id, taxable income and tax into a file calledtaxreport.txt. The format of the taxreport.txt file is as follows.

Employee ID

Taxable Income

Tax

1111

100000.00

20303.00

2222

90000.00

19933.00

Once the tax calculation is done for one employee then the program will ask if XZY wants to calculate the tax for another employee, if yes then the above process will continue again. The program will calculate the tax for as many employees as XYZ wants. However, if XZY does not want to calculate the tax for another employee then main menu will be displayed.

When2 is selected then the program will search the tax for an employee using the employee id in thetaxreport.txt file. However, if thetaxreport.txt file does not exist in the directory of the source code then the program should ask to provide thetaxreport.txt file as an input.

If the taxreport.txt file contains the multiple tax for the same employee then the program will get the latest tax amount of that employee. If thetaxreport.txt file does not contain the employee id then the program should give an warning message that thetaxreport.txt file does not contain the tax of that employee.

Once searching tax (based on employee id) is done for one employee then the program will ask if XZY wants to search tax for another employee, if yes then the above process will continue again. The program will search tax for as many employees as XYZ wants. However, if XZY does not want to search tax for another employee then main menu will be displayed.

When3 is selected then the program will exit.

File read and write operations need to be done properly. You need to use proper data structure. Input validation also needs to be done.

 

Task

In this part of your assignment you are required to produce a fully functional GUI program in accordance with the specifications mentioned below. The program will be used to determine and display the final mark of students enrolled in the “Programming in Java 2” subject. It will also have the capability to calculate and display the average mark for all students entered into the system.

Part 1 Elements of the GUI :

  • An appropriate title appearing on top of the main frame of the GUI (eg. “Grade Processing Programming in Java 2”)
  • Six text fields with appropriate labels namely “Student ID”, "Student Name", “Quiz Marks”, “Assignment 1 Marks”, “Assignment 2 Marks” and “Exam Marks” to take user inputs
  • Two buttons (“Student Marks” and “Average Marks”) used to trigger actions for calculations
  • A lower part (section) of the GUI will contain the Student Name, Student ID, Quiz marks, Assignment 1 marks, Assignment 2 marks, Exam, Results and Grade.
  • Please see the figure below to get an idea about the GUI

 

Part 2 Functionality:

  • For each student, user enters “Student ID”, "Student Name", “Quiz”, “Assignment 1”, “Assignment 2”, and “Exam” marks. The mark on each assessment items has to be an integer between 0 and 100 (inclusive). Input validation needs to be done on each assessment mark to make sure that the mark on each assessment is in between 0 and 100.
  • User then presses the “Student Marks” button to calculate the final marks and grade for the student. The weights on Quiz, “Assignment 1”, “Assignment 2”, and “Exam” are 5%, 20%, 25% and 50%, respectively.
  • Calculate Results: The results of a student should be calculated using the following formula:

Results = (Quiz marks* 0.05) + (Assignment 1 marks * 0.20) + (Assignment 2 marks * 0.25) + (Exam marks* 0.5)

  • Calculate Grade:

HD: Results>=85
DI: 75CR: 65PS: 50FL: 75

  • The users of the program are allowed to enter marks for as many students as they want
  • The lower part of the GUI will contain the Student Name, ID, Quiz marks, Assignment 1 marks, Assignment 2 marks, Exam marks, Results and Grade of 10 recently entered students.
  • Input validation needs to be done
  • When a user clicks the “Average Marks” button then the average marks for all students entered will be displayed.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE