Write java console application that allow user to store data

Assignment Help JAVA Programming
Reference no: EM132380819

Assignment - Need to do Java programming.

Assignment task - Write a java console application that allows the user to read, validate, store, display, sort and search data (name, age, taxable income, tax, tax group) for N taxpayers. N should be declared as a constant and it should be equal to the largest digit of your student id number (e.g. if your ID number is S1267222 then N should be equal to 7 and you can declare it as final int N=7;). The name, age and taxable income must be read from the keyboard and tax and tax group must be calculated using Table 1.

Table 1. Income Tax and Tax Group for Taxable Income

Taxable Income

Income Tax

Tax Group

$0 - $18200

$0

Group 1

$18201- $37000

$0 plus 19c for each $1 over $18200

Group 2

$37001 - $87000

$3572 plus 32.5c for each $1 over $37000

Group 3

$87001 - $180000

$19822 plus 37c for each $1 over $87000

Group 4

$180001 and over

$54097 plus 45c for each $1 over $180000

Group 5

The name, age, taxable income, tax and tax group must be stored in an Array or ArrayList (index 0 for taxpayer 1 and index N-1 for taxpayer N). The minimum and maximum ages which can be stored are 18 and 64. The minimum and maximum taxable incomes which can be stored are $1 and $999000. A validation for minimum and maximum values must be done during the reading of age and taxable income.

Your application should display and execute a menu with the following options. A switch statement must be used to execute the following menu options.

1. Read, validate and store data for N taxpayers.

2. Calculate and store tax and tax group for all taxpayers.

3. Display all taxpayers.

4. Display the name and age of all taxpayers from tax group 1.

5. Search a taxpayer by age.

6. Sort and display taxpayers.

7. Exit from the application.

1. Read, validate and store data for N taxpayers

This option reads name, age and taxable income for N taxpayers from the keyboard and stores them in an Array or ArrayList. If the age is less than 18 and greater than 64 then an appropriate message should be displayed and the user should be asked to enter the age again. Similarly if the taxable income is less than $1 and greater than $999000 then an appropriate message should be displayed and the user should be asked to enter the taxable income again.

2. Calculate and store tax and group number for all taxpayers

This option calculates the tax and group number based on Table 1 for each taxpayer and then stores tax and group number in Array or ArrayList.

3. Display all taxpayers

This option displays the data (name, age, taxable income, tax, group number) for all taxpayers.

4. Display the name and age of all taxpayers from tax group 1

This option displays the name and age of all taxpayers from tax group 1. If there is no taxpayer in group 1 then it displays an appropriate message.

5. Search a taxpayer by age

This option asks user to enter the taxpayer's age and searches for it. If the age is found then it displays an appropriate message with taxpayer details (name, age, taxable income, tax, group number). If age is not found then it displays an appropriate message "taxpayer with given age is not found". If there is more than one taxpayer with the given age then it displays all of them. A built-in search algorithm is not allowed in this assignment.

6. Sort and display taxpayers

This option sorts (by name) all taxpayers stored in Array or ArrayList in descending order and displays all sorted taxpayers (name, age, taxable income, tax, group number). You can use any sorting algorithm. A built-in sort algorithm for sorting is not allowed in this assignment.

7. Exit from the application

The application should display an appropriate message with student name and then exit from the application.

The application should work in a loop to enable the user to read, validate and store data for all taxpayers, calculate and store tax and tax group for all taxpayers, display all taxpayers, display the name and age of all taxpayers from tax group 1, search a taxpayer by age, sort and display taxpayers and exit from the application.

Program design - You may use any design that meets the specification. However, a good design will adhere to the following guidelines:

  • be logically correct
  • be easy to read and maintain
  • be well-designed
  • use a UML activity diagram
  • use appropriate classes, methods and fields

Your design MUST use the classes as listed below.

public class Taxpayer

{

//fields to store name, age, taxable income, tax, group number

//relevant methods including set and get methods

}

public class TaxpayerTest

{

public static void main(String[] args)

{

//menu options using switch statement

//data reading, Taxpayer object creation, data storing in array/arrayList, etc.

}

//other static methods

}

You may add/use methods, parameters, fields/variables, constants, etc. which you need to complete the application.

Testing - Testing is important. You should test your application using many different types of test cases before you submit it for marking.

What to submit - You should submit online the following files.

Taxpayer.java (this file contains java code for class Taxpayer)

TaxpayerTest.java (this file contains java code for class TaxpayerTest).

Report.docx (this file contains a brief report that includes student name, student ID, unit name, unit code, UML activity diagram for menu option 2 (calculate and store tax and group number for all taxpayers) and test results (screenshots for different test cases with results to show that your application is correctly working)).

Reference no: EM132380819

Questions Cloud

Individuals to be successful leaders : What traits are necessary for individuals to be successful leaders?
Scott gottlieb director of the united states : If you were Scott Gottlieb director of the United States food and drug administration what regulatory policies if any would you propose to Juul
How is patient privacy and confidentiality protected : What electronic communication strategies are used at your organization to communicate with patients? Based on your organization's HIPAA policy.
How issues currently affecting the nursing workforce : Discuss how issues currently affecting the nursing workforce will affect you as an individual. How will the nursing workforce shortage affect the profession.
Write java console application that allow user to store data : Write a java console application that allows the user to read, validate, store, display, sort and search data for N taxpayers
How does the use of tools affect family risk appraisal : Discuss how genogram and ecomaps are used in nursing. Why and how would they incorporate these tools into their care of families?
What you are going to do and the position you are adopting : In your introduction outline what you are going to do and the position you are adopting - please use your introduction as a map to cover the points
Describe the policy health issue in brief : Describe the policy health issue. Include the following information: (a) what population is affected, (b) at what level does it occur (local, state).
Identify potential hazards of hospitalization : Identify potential hazards of hospitalization for all older adult patients (including immobility, delirium, medication side effects, malnutrition.

Reviews

len2380819

10/2/2019 11:21:42 PM

Warning: You must submit your own work and correct files. You should not take any help from anyone and you should not show your code to anyone. If you have any problem, you should talk to your tutor or lecturer or unit coordinator. Marking criteria: Design, logic and testing – 14 marks, Compilation and execution - 14 marks, Report – 2 marks. Penalty - Penalty for submission of incorrect files including names and formats is 2 marks and Penalty for late submission is 5% mark / day or part of a day.

Write a Review

JAVA Programming Questions & Answers

  Create a class called studentquizscores

Within DrJava, create a class called StudentQuizScores and do the following using a loop. Your program should display this string using a JOptionPane.

  Computes the raise and new salary for an employee

Computes the raise and new salary for an employee. Complete the following program to determine the raise and new salary for an employee by adding if ... else statements to compute the raise

  Write the java code for classes team and player

Write the Java code for classes Team and Player. Declare the classes in package com.myleague.reg. Provide an implementation of all methods according to the given method names. You can use the class Random fromjava.util to randomly pick a student

  Java program simulate a network

Java program simulate a network

  Design an object hierarchy

Design an object hierarchy and design your own UML class diagram to reflect the classes and relationship required by your program.

  Define get and set functions and two constructors

Create a class called Building. It will have one data member of type string (used for a postal address). Define get and set functions and two constructors.

  What is the method for broadcasting an intent

What is the method for broadcasting an Intent? What is the method for saving the Activity state? What is the method for retrieving application assets? What is the method for accessing application preferences?

  Implement the interface map

Define the interface Map. A class that realizes Map has to save the key-value association. In our case, we need a Map to contain identical keys

  Write a program that computes a final grade

COMP1006/1406 - Summer 2016 - Write a program that computes a final grade, as specified in the course outline using the six term marks: assignments, project, tutorials, quizzes, midterm and final exam.

  Create an application that keeps tracks of the information

Create an application that keeps tracks of the information in such a simple social network. More specifically, your application will allow for user profiles to be added to, deleted from, or looked-up in the social network.

  Write an application that present user with a menu of tasks

Write an application named, Names.java, that presents the user with a menu of tasks and continues reading a user selection and performing tasks.

  Complete the method named countoutofrange

The element is greater than or equal to min AND less than or equal to max. The method should return the new array -

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