Answer to Question #6635 in Java | JSP | JSF for Josh Rider

2012-02-16T09:01:25-0500

Question #6635

Problem Description: 1. Prompt the user to enter a whole number from 1 to 9 inclusive. The number zero (0) will be used to exit the application. If any other number is entered, then an error message shall be displayed and then the prompt to enter a whole number will be re-displayed. 2. Create a pyramid structure by using only the odd numbers without going over the number entered in by the user. For example: If the user entered in 8, then construct your pyramid using the numbers 1, 3, 5, and 7. 3. The pyramid shall be constructing by repeating the odd number the same number of times as its value. For example: The number 1 will be repeated only once. The number 3 will be repeated three times. The number 5 will be repeated five times. 4. The pyramid shall be centered accordingly, with the highest odd number being the most left align. This will require you to calculate the center of the pyramid based upon the highest odd number. The number one (1) will always be in the center