Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with constructing Java arrays

 
Amir Ahmed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone!

I'm working on writing a code that calculates income tax and store them in arrays. The program calculates tax per users input. I've wrote the code that gets the gross income then calculate the tax due after deducting dependents exemption. The program must use JOptionPane dialog box to get users input. User inputs are first name, last name, gross income, and number of dependents. I used "for" loop to collect the users input for however many users tax needs to be calculated. What i'm having trouble with is after asking the user how many users to calculate taxes for,

1. after collecting the user inputs, how do I store them in a array?
2. how do i assign to string and integer after parsing the gross income and number of dependents. I'm trying to use the array to display the first name, last name, gross income, and number of dependents all in a single dialog box?

I've seen other posts but most of them were really confusing and left wondering....

Thanks!
 
Mansukhdeep Thind
Ranch Hand
Posts: 1158
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amir Ahmed wrote:...

1. after collecting the user inputs, how do I store them in a array?
2. how do i assign to string and integer after parsing the gross income and number of dependents. I'm trying to use the array to display the first name, last name, gross income, and number of dependents all in a single dialog box?

I've seen other posts but most of them were really confusing and left wondering....

Thanks!


May we see what you have written until now?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic