Reference no: EM133130127
SENG1110 Object Oriented Programming - The University of Newcastle
Income Tax and Investment Calculator
The objective of this assignment is the implementation of an object-oriented program using Java to calculate income tax and investment growth based on the yearly income/salary of an individual. Below the details are described (The rules in this assignment are different from Australia Taxation Office). The assignment 2 will be an extension of this assignment.
Befofe you start
Carefully read the specification below. Make sure you have all the information necessary to start writing the program. If you are uncertain of something, do not make assumptions. Post your questions to the discussion board forum named "assignment 1" and check it regularly.
Try to start the assignment as soon as possible. There is a document "HelpToStartAssign1" and some Java files on Blackboard, which you can use as a starting point.
Problem specification
In Australia, a taxpayer's income is taxed progressively. Progressive taxation means that higher income earners pay more tax than lower income earners. The following tables detail the tax brackets of our progressive tax system for the financial years ending 30 June 2021 and 30 June 2022. Note that the first table is for Australian residents and the next one is for non residents.
Tax rates 2010-11 - residents
Residents are also required to pay 2% of Medicare levy if your taxable income is greater than $29,032, which is calculated at 2% of your taxable income. Non-residents are not required to pay the Medicare levy.
The first task of the program is to calculate the appropriate income tax for an individual based on a set of inputs by the user and the information provided in the Tax tables above. The user should provide the program with
• Name (the name needs to have at least two names - first name and last name; if not, the program will show an error message and ask the user the name again),
• Annual income/Salary (income) for an entire year (the salary needs to be a positive number and different from zero; if not, the program will show an error message and ask the salary again)
• Residence - if the user is a resident or not. The program is then expected to display:
• the net salary of this particular individual per year and per week.
• The correct amount of tax the individual should pay per year and per week (as defined by the Tax rates above).
• If the individual pays the Medicare Levy and if so, how much per year.
The second task of the program is to calculate/display a possible investment. First, the program should ask
• the amount of money that the user requires (on an average) per week as living expenditure. You are to assume this expenditure value does not change for the individual over time. (the amount needs to be a positive number and different from zero; if not, the program will show an error message and ask the salary again)
• On the basis of this information the program should advise the user whether or not the amount the user is earning each week is sufficient to cover the weekly expenses. If the user earns less than the amount that is required to live, you should show a warning message and ask if the user would like to enter a new amount or terminate the program.
• If an amount is sufficient to cover weekly expenses, the program should ask if the user would like to invest some money. If yes, the program should ask
- Investment value - the amount of money that the user would like to invest per week (it is necessary to verify if this amount is feasible. If not, show an error message and ask again)
- Interest rate - the interest rate of the investment account per annum (the interest rate needs to be between 1% and 20%; otherwise the program will show an error message and ask the user for the interest rate again)
- Investment length - number of weeks that the user will invest the money (it needs to be a positive number and different from zero; otherwise the program will show an error message and ask the number of weeks again)
• The program is then expected to display:
- a table with details of the investment at four week intervals for the length of the investment. For the purposes of this assignment you will assume that interest is only applied at the end of a complete four week period, see the example below.
Program Requirements
There must be three classes: Client, Account, CalculatorInterface.
• The Account Class (the file needs to be Account.java) The instance variables will be (at least):
• rate - double
• numberOfWeeks - int
• amount - double
The class needs to have methods to change and access all instance variables and also the method (at least) calcInvestment(), which will calculate the investment and will return a String, which will have the amount in the investment account in the end of each month. The instance variables will be private.
• The Client Class (the file needs to be Client.java) The instance variables will be (at least):
• name - a String
• savingAccount - Account
• grossSalary - double
• netSalary - double
• resident - boolean
• tax - double
• medicare - double
• weeklyExpenses - double
The class needs to have methods to change and access all instance variables. It also will have (at least) the methods calcTax(), which will calculate the tax and calcMedicare(), which will calculate the medicare. The instance variables will be private.
• The CalculatorInterface Class (the file needs to be CalculatorInterface.java) Creates the interface (TerminalIO or GUI, you choose).
The instance variables will be (at least):
• client - Client
This class will receive the inputs from user, show the outputs, will check for wrong inputs and show error messages.
Notice that only this class will receive inputs and show outputs.
This class is the only class that will have a main method, which should create an instance of the class CalculatorInterface, and call a method run(), which will display the menu to the user. A template is shown below.
public class CalculatorInterface { private void run(){
//...
}
public static void main(String[] args){
CalculatorInterface c = new CalculatorInterface (); c.run();
}
}
You must not use any form of arrays in this assignment.
Marks will be awarded for layout (including visual aspects (variable names, indentation) and structural aspects (variable scope, method usage)), documentation (comments), and the submission's ability to perform as specified. A more detailed marking schema is available on Canvas.
Attachment:- Investment Calculator.rar