#Make a menu that will display different outputs using methods [ No one has helped yet ]

1 messages · Page 1 of 1 (latest)

tardy portalBOT
#

Detected code, here are some useful tools:

[WARNING] The code couldn't end properly...

Problematic source code:

public static void main(String[] args) {
        int option = 0, L = 0, R = L - 1, number, prime;
        Scanner keyb = new Scanner(System.in);
        
        System.out.println("__________________________________________________");
        System.out.println("MENU");
        System.out.println("[1] Find Factors of a number ");
        System.out.println("[2] Draw a pyramid based on an integer");
        System.out.println("[3] Find prime numbers");
        System.out.println("[4] Draw a calendar");
        System.out.println("[5] Exit program");
        
        System.out.println("Please enter an option 1 thru 5");
        option = keyb.nextInt();

        
        if (option == 1)
        {
            System.out.println("Enter an integer");
            number = keyb.nextInt();

            System.out.println("The Factors of " + number + " are:");
            for (int i = 1; i <= number; i++)
                if (number % i == 0) 
                {
                    System.out.println(i);
                }
        }
        else if (option == 2)
        {
            for (L = 1; L <= 5; L++)
            {
                for (R = 1; R <= L; R++)
                {    System.out.print(R + " ");    }
                //for (R = 2; R <= L; R++)
                    //System.out.println(R + " ");     
                {    System.out.println();    }
            }
        }
{ PART 2 NOT HERE } 
            System.out.println();
            System.out.println("THANK YOU FOR USING (Name's) MENU");
        System.out.println("__________________________________________________");     
}```
Cause:
The code doesn't compile:
not a statement
';' expected
';' expected

Remaining code:
```java

}```
## System out
[Nothing]
#

<@&987246527741304832> please have a look, thanks.

craggy sleet
#

What's your specific question?

#

Ideally mention what your issues are, and where you're stuck. Now you just shared your assignment, and current code.

#

So you know how many rows you need, so you can determine how many leading spaces you need for your pyramid.

small onyx
#

Make a menu that will display different outputs using methods [ ⁉ ]

#

Make a menu that will display different outputs using methods [ No one has helped yet ]

craggy sleet
#

What specifically more do you need help with? Have you tried adding the leading logic? It's basically the same but inverse.