Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Problem using [repeating it's output]

$
0
0
So I'm doing a program that would require to enter a number and enter it's alphabet the output should be like this.

Output (Should be):
|a
Next input b:
|b|a

So happens that its like this:
Output (My program output):
|a
Next input b:
|b

        do{
            System.out.println("\n\nPlease enter your choice from the following menu:");
            System.out.println("1. Enter number");
            System.out.println("2. Exit");
            choice = Integer.parseInt(reader.readLine());
        switch (choice){
            case 1:
            System.out.print("Enter number: ");
            find=Integer.parseInt(reader.readLine());
            
            for(i=0;i<anNumber.length;i++){
                if(find == anNumber[i]){
                    anFinals[i] = anLetters[i];
                    System.out.print("| "+anFinals[i]);
                }
            }
            case 2:
            break;
        }   
        }while (choice > 0 && choice < 2);


Viewing all articles
Browse latest Browse all 51036

Trending Articles