Java Program



Task 1: Tax Management System 

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

When 1 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 called taxrates.txt. The program needs to read the taxrates.txt file and store the information in proper data structure. If the taxrates.txt file does not exist in the directory of the source code then the program should ask to provide the taxrates.txt file as an input. The format of the taxrates.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 – $90,000
$3,572 plus 32.5c for each $1 over $37,000
$90,001 – $180,000
$20,797 plus 37c for each $1 over $90,000
$180,001 and over
$54,097 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 in taxrates.txt file) of the employee. For  example, if the annual income of an employee is $100000.00 then the tax of the employee=20797+(100000 - 90000)*0.37= 24497.00 
After calculating the tax of an employee the program will then write the Employee Id, taxable income and tax into a file called taxreport.txt. The format of the taxreport.txt file is as follows.

Employee ID
Taxable Income
Tax
1111
100000.00
24497.00
2222
90000.00
20797.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.
When 2 is selected then the program will search the tax for an employee using the employee id in the taxreport.txt file. However, if the taxreport.txt file does not exist in the directory of the source code then the program should ask to provide the taxreport.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 the taxreport.txt file does not contain the employee id then the program should give an warning message that the taxreport.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.
 When 3 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 2: Display the records of clusters (5 marks)

A clustering technique called "Unique Neighbourhood Set Parameter Independent Density-Based Clustering with Outlier Detection" (PIDC-O) is applied on a dataset having 450 records and two attributes (X, Y). The number of clusters produced by PIDC-O from the dataset is four namely Cluster1, Cluster2, Cluster3 and Cluster4.  A text file (cluster.txt) that contains the clusters will be uploaded into the subject interact site soon. For better understanding, the structure of the text file is discussed using the table below. 

X
Y
Cluster
2
4
Cluster1
6
8
Cluster2
7
8
CLuster2
3
4
Cluster1
2
5
CLuster1
3
5
Cluster1
7
9
Cluster2
2.5
4.5
Cluster1
6.5
8.5
Cluster2

The number of records in the above table is nine, the number of attributes is two (X,Y)  and the number of clusters is two (Cluster1, Cluster2) whereas the cluster.txt in the subject interact site will have 450 records, two attributes (X,Y) and four clusters (Cluster1, Cluster2, Cluster3, Cluster4). The sample output on the above table is shown below. 
Write a Java Graphical User Interface (GUI) program that will read the cluster.txt file and will display the records of the clusters in cluster.txt file in GUI. The records in a particular will be displayed using a single color. Add legend for each cluster in the GUI, so that the clusters can be easily identified.

Task 3: Traffic Light Simulation (5 marks)

Write a GUI program that models a set of traffic lights. The lights should appear vertically within the window as shown in the image below. Only one light (red, yellow or green) should be switched on at any one time, based on the selection of a radio button at the bottom of the window. When the program first starts, all lights should be switched off. Layout your components as per the image below.
Acknowledgment
Task 3 is based on Exercise 16.3 in the textbook.

Rationale

back to top
This assessment task will assess the following learning outcome/s:
  • be able to create, manage and manipulate objects via the Java Collections Framework.
  • be able to design and construct Java Graphical User Interfaces (GUI) that interact with problem domain objects.

Presentation

back to top
Following items are to be submitted in the TURNITIN (For each task):
  • Report: The report (in .doc or .pdf format) should explain how to run your program and any settings needed to run your program. Enough number of screenshots should be shown in the document. In case if the assignment marker fails to run your program, because of any inconvenience, these screenshots would show how the program worked on your machine/environment.
  • Source code and other files: All source codes, exe file and other relevant files must have to be zipped in a folder such that unzipping would keep the file/folder structure unaffected.
To get solution visit our website www.sourceessay.com

Comments

Popular posts from this blog

Assignment Help: Add Valuable Factors In Your Learning Skills

The Helpful Essay Writing Guide: Structure, Outline, Tips And Format

Language Techniques Every Student Must Know