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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Java program

  • 18-10-2007 4:25pm
    #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

  • Registered Users, Registered Users 2 Posts: 271 ✭✭homerjk


    What have you got so far?
    Where are breaking down? (What is the error that is blocking you?)

    Also, you should really post this or get it moved to the Programming board.


  • Closed Accounts Posts: 11 irishgem


    Ok, well if I show you what I have, you will laugh but will show anyway as will demonstrate how bad I am and that haven't a clue!!! I don't have any methods. Have the arrays wrong etc

    importjavaswing.JOptionPane ; */
    public class Music
    {


    public static void main(String[] args)
    {
    int numEnter;

    String [] artist ={"Bob Marley", "Pink Floyd", "Bob Dylan", "The Doors, ", "Therapy?"};
    String [] title ={"No woman no cry", "Wish You were Here", "The Alabama Song", "All Over You", "Screamager"};
    int[]year ={1975,1975,1967,1962,1992};

    JOptionPane.showinputDialog ("Enter a number between 1 and 5");
    for(int i=0;i<5; i++)

    System.out.println( "Artist is" + artist, "Title is" + title, "Year is" + year);
    JOptionPane.showMessageDialog(null, "Artist is" + artist, "Title is" + title, "Year is" + year, JOptionPane.INFORMATION_MESSAGE);
    }


This discussion has been closed.
Advertisement