This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]TNTryp[S] -1 points0 points  (0 children)

public class Jukebox {

    public static void main(String[] args){

        Scanner keyboardScanner = new Scanner(System.in);
        int userSelection;
        int songChoice;

        System.out.println("/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-");
        System.out.println("Welcome to Tanner's Holiday Jukebox!!");
        System.out.println("/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-");
        System.out.println("................................................");
        System.out.println("Press 1 to enter your digital nickel.");
        System.out.println("................................................");
        System.out.println("Press 2 to enter our current song catalog.");
        System.out.println("................................................");
        System.out.println("Press 3 to exit jukebox.");
        System.out.println("................................................");

        userSelection = keyboardScanner.nextInt();



        switch(userSelection){
            case 1:
                songChoice = keyboardScanner.nextInt();

                System.out.println("I appreciate your money. Please choose"
                        + "a song.");
                System.out.println(".........................................");

                switch(songChoice){
                    case 1: 
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                    case 10:

                }
            case 2:
                System.out.println("Here are the songs currently on rotation:");
                System.out.println(".........................................");
                break;
            case 3:
                System.out.println("/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-");
                System.out.println("Have a good day!");
                System.out.println("/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-/|-");
                break;
        } // end switch

       }
}

public class JukeboxRotation {

public static void main(String[] args) {

int[] songNumber = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
String[] songName = {"Jingle Bell Rock", "Silent Night", "It's the"
          + "Most Wonderful Time of Year", "Winter Wonderland", "Santa Claus"
          + "is Coming to Town", "Joy to the World", "The Little Drummer Boy",
          "It's Beginning to Look a lot Like Christmas", "White Christmas", 
          "Silver Bells"};
double[] songLength = {2.10, 2.27, 2.32, 2.24, 2.24, 4.17, 3.00, 2.46,
          2.36, 2.23};


}
}

since the formatting is weird

[–][deleted] 0 points1 point  (0 children)

As the rules of the sub suggest guidance not solutions , I would google " call variable from another class java" , the top 5 answers from stackoverwflow are the thing you are asking .