Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

java program looping through 3 arrays

Options
  • 18-10-2007 5:51pm
    #1
    Closed Accounts Posts: 11


    Please, could somebody help me here. I'm crap at Java and need to write out this simple enough progam for college. Needs to be in tomorrow and have spent ages trying to do it but it's still wrong, too many errors, won't compile, etc. Meant to be using a method in it but just can't do this program. Any sort of help at all would be appreciated!

    Capture information relating to your CD collection

    Prompt for number of CD's that you are going to enter
    use JOptionPane to collect data

    Loop correct number of times to collect the details of each CD from the user
    use JOptionPane to collect data

    Perform simple error checking on input
    E.g. check that the user input something
    Populate 3 arrays with the information collected

    CD collection
    Artist
    Title
    Year

    Display the CD collection back to the user
    format output
    one row per CD

    Use both System.out.println and JOptionPane to display output


Comments

  • Closed Accounts Posts: 20,759 ✭✭✭✭dlofnep


    Why not just create a CD object and just create an array of them. Or does it have to be a 3d array?


  • Registered Users Posts: 981 ✭✭✭fasty


    That's a good place to start.

    Make a a CD Collection object with 3 arrays and some methods that let you add a CD entry and another that lets you get a CD entry at a particular index.

    Once that's done and compiling without errors move on to data input and output.

    No one's really going to help you more than that unless you post some code and say exactly what you've tried and what errors you get.

    Programming is easy if you break a problem down into parts and just google or use a book to look up errors and find exampless.


  • Closed Accounts Posts: 11 irishgem


    thanks for your help. Will try some more


Advertisement