0

When I enter done that doesn't work and it won't put the what I say that my title is for when it says please enter the relase year for? I don't know if my variables are initialized correctly?

// variables local to main
        String title = "";
        int releaseYear = 0;
        String artist = "";
        double length = 0;
        String genre = "";

// Sentinel- controlled while loop

        JOptionPane.showInputDialog(null, "Please enter a song title: " + Song.SENTINEL + " to quit:");
        while (!(title.equals(Song.SENTINEL))) {
            do {
                Integer.parseInt(JOptionPane.showInputDialog(null, "Please enter the release year for " + title));
            } while (releaseYear > 0);
            JOptionPane.showInputDialog(null, "Please enter the artist for " + title);
            do {
                Double.parseDouble(JOptionPane.showInputDialog(null, "Please enter the legth for " + title));
            } while (length > 0);
            JOptionPane.showInputDialog(null, "Please enter the genre for " + title);
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by BestJewSinceJC
0
JOptionPane.showInputDialog(null, "Please enter a song title: " + Song.SENTINEL + " to quit:");

should be

title = JOptionPane.showInputDialog(null, "Please enter a song title: " + Song.SENTINEL + " to quit:");

and similar methodologies can fix the rest...

Edited by BestJewSinceJC: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.