Income tax and investment calculator

Assignment Help JAVA Programming
Reference no: EM133148083

SENG1110 Object Oriented Programming - The University of Newcastle

Income Tax and Investment Calculator

Introduction
The objective of this assignment is to extend the implementation of Assignment 1 using arrays (as seen in weeks 9 and 10) and external files.

SENG1110 students - This assignment can be completed in pairs. SENG6110 students - This assignment must be completed individually.

Before you start
Carefully read the specification below. Make sure you have all the information necessary to start the program. If you are uncertain of something, do not make assumptions. Post your questions to the discussion board forum named "assignment 2" and check it regularly.

Problem specification
The program will allow up to 5 clients and each client will be able to have 2 accounts. The program will have the following options:

• Add a client
If the number of clients is already 5, the program will say that it is not possible to add an extra client. If the number of clients is less than 5, then the program will ask the following inputs:
- Client 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. In addition, if a client with that name already exists, the program will show an error message, and asks again.
- Client annual income/salary 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.
- Expenses - 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 less than the net salary; if not, the program will show an error message and ask the expenditure again.

• Delete Client
The user needs to enter the client name. Then, the program will delete the client and will display the message "the client was deleted". If the name is not found, the program will display the message "the client does not exist". It is not necessary to ask again.

• Display a client
The program will ask the name of the client. If the name does not exist, show a message. If the name exists, then the program will display the following information of the Client:
- Name
- Gross salary per year and per week.
- Residency status
- The amount of tax the individual pay per year and per week (as defined by the Tax rates described in assign1).
- The net salary per year and per week (calculated the same way as in the assign1).
- If the individual pays the Medicare Levy and if so, how much per year.
- Expenses per week.

- The remaining amount possible to be invested per week. The remaining amount possible to invest is net salary less expenses less the amount already invested (in case the client already has an account). For example, If the net salary is $500 per week, expenses are $100, and the user has one account already investing $200 per week, then the remaining amount available to invest is $200 (500-100-200) per week.
- Each account information, which will be:
- Amount invested per week
- Interested rate
- Number of weeks
- Total amount in the end of the period

• Display all clients: If it does not have any client, the program will display the message "no clients". If clients exist, the program will display the following information of all clients.
- Client 1:
o Name:
o Resident:
o Gross salary (per week):
o Net salary (per week):
o Tax (per week):
o Medicare (per week):
o Expenses (per week):
o No accounts (if the client does not have any account) OR
Number of Accounts:

- Client 2:
...
etc

• Add an account
The program will ask the name of the client. If the name does not exist, show a message. If the name exists, then the program will check if the client already has 2 accounts. If it is 2, the program will show a message. If it is less than 2, then the program will 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). To be considered a feasible amount, it should be less than the remaining amount available to invest. If not, ask again. For example, if the net salary is $500 per week, and the user has no account, and expenses are $100, then the remaining amount available to invest is $400. If the net salary is $500 per week, and the user has one account already investing $200 (and expenses are $100), then the remaining amount available to invest is $200.
- 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)

• Display account.
The program will ask the name of the client. If the name does not exist, show a message. If the name exists, then the program will ask the account number (1 or 2, which is the first or second position in the array). If the account does not exist, the program will display the message "the account does not exist". If not, the program will display the following data about the client and account:

- 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. Exactly as assignment 1.

• Delete Account
The program will ask the name of the client. If the name does not exist, show a message. If the name exists, then the program will ask the account number (1 or 2, which is the first or second position in the array). If the account exists, then the program will delete the account and the program will display the message "the account was deleted". If the account does not exist, the program will display the message "the account does not exist".

• Save in a file
The program will save in a file (txt format) the information of each client (the same information described in "show a client" above) and each account (the same information described in "display account" above). If there are no clients, the files should have "no client". For each client, if the client does not have an account, the file should have "no account".

• Exit. The program will end.

Program Requirements

There must be at least three classes: Client, Account and CalculatorInterface.

• The Account Class (the file needs to be Account.java)

You must have the following instance variables (you can include others if you feel they are necessary) and all instance variables must be private.
• rate - double
• numberOfWeeks - int
• amount - double
You need to implement at least two constructors. One will be the default one, it will initialize the variables with 0 or "". The second constructor will have the parameters rate, numberOfWeeks and amount. The class needs to have methods to change and access all instance variables. You will decide which will be the other methods to be implemented in this class.

• The Client Class (the file needs to be Client.java)

You must have the following instance variables (you can include others if you feel they are necessary) and all instance variables must be private.
• name - a String
• grossSalary - double
• netSalary - double
• resident - boolean
• tax - double
• medicare - double
• weeklyExpenses - double
• account - one-dimensional array of Account objects (size 2)

It will hold the required instance data for a client and it will have suitable methods to access and modify the data for a client. You will decide which will be the other methods to be implemented in this class.

• The CalculatorInterface Class (the file needs to be CalculatorInterface.java)

You must have the following variables (you can include others if you feel they are necessary)
• clients - one-dimensional array of Client objects (size 5)
• noClients - the number of clients (it will start with zero). This variable can be declared in the Client class as static variable.
You will decide which methods will be implemented in this class.
This class will create the interface (Terminal IO or GUI, you choose). Only this class will
• Receive the inputs from user and show the outputs.

• Validate input (ie. Negative numbers etc).
• Show error messages.
Notice also that only this class needs to be modified if you decide to implement more than one interface (TIO and GUI).

Attachment:- Income Tax and Investment Calculator.rar

Reference no: EM133148083

Questions Cloud

Questions about the value of deloitte professionals : While Pier had experienced pockets of success with several professionals. many others rejected the approach. Bondili and the team found substantial resistance t
Why do stakeholders in the same organization : Why do stakeholders in the same organization often have different goals? Would it not be best if they shared the same goals? Explain.
Analyze starbucks company : Research and analyze Starbucks Company and answer the questions below: Questions:
Calculate the initial markup percentage required : "A retailer in a boutique jewelry store has estimated expenses of 49%, markdowns at 15%, and stock shortage at 6.3%. A profit of 4% is desired. Calculate the i
Income tax and investment calculator : Income Tax and Investment Calculator - implement at least two constructors. One will be the default one, it will initialize the variables
Explain the issues with excluding the monthly salary : Your company is considering paying a commission to the sales force to expand sales. You are charged by the Chief Financial Officer with 1) computing a new break
Strategic value of upgrading the organizational website : Write a 600-word (minimum length) position paper in which you argue for, or against, the strategic value of upgrading the organizational Website.
Explain the order-processing system : Using suggestions/best practices and your knowledge of use cases, explain in point form the corrections that you would make to this set of main flow of activiti
Three sales goals using the smart formatting : Three sales goals using the SMART formatting (specific, measurable, achievable, relevant, and time-based)

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a java application titled mystringtest

Write a Java application titled MyStringTest that creates an instance of the String class and initializes this instance with a String literal.

  Minimal spanning tree decreasing edge

minimal spanning tree decreasing edge dismissalreverse-delete algorithm. develop an implementation that computes the

  Designing an inheritance between classes

Why is an "is-a" relationship important when designing an inheritance between classes

  Punished for minor infractions given their mental illness

What if you a Disciplinary Hearing Officer in a unit with mentally ill inmates? How would you sanction offenders for infractions without punishing them for their illnesses? Do you think they should be punished for minor infractions given their mental..

  Requests the user to enter a value

Requests the user to enter a value, and searches the array to find a matching value. If there is a match, display Match; otherwise, display No Match.Display only one message at the end of the search.Write the code so the search stops when a match is ..

  Write down a java gui application index2java based on the

write a java gui application index2.java based on the program in step 1 that inputs several lines of text and uses

  Write a class named player that stores a players name

Write a class named Player that stores a players name and the players high score - Write a class that manages a list of up to 10 players and their high scores

  Reads an input record and prints the name

Reads an input record and prints the name if the current total is less than the limit.

  Java application to read all data from the file

Java application to read all data from the file echoing the data to standard output. After all data has been read, display how many data were read.

  Design and implement an algorithm that prevents deadlock

COMP2240/COMP6240 - Operating Systems Assignment - Using semaphores, design and implement an algorithm that prevents deadlock

  Definition of constant initialization arrays

You have to extend the definition of constant initialization arrays to multi-dimensional arrays

  Make a simple program in the python computer programming

The program is to have two functions: a main function and a helper function.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd