akosiraff

Largest PalinDrome Diamond JAVA

Sep 16th, 2013
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/largest-palindrome-diamond-java/
  3. Write a Java application program called Largest.java that inputs a series of 10 single-digit numbers and determines and prints the largest of the numbers. Except main() method, no other user-defined method is required. Your program should use at least the following three variables:
  4. a) counter: A counter to count to 10 (that is, to keep track of how many numbers have been input and to determine when all 10 numbers have been processed);
  5. b) number: The current digit input to the program;
  6. c) largest: The largest number found so far.
  7. STEP 2: Palindrome
  8. A palindrome is a sequence of characters that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write an application called Palindrome.java that reads in a five-digit integer and determines whether it is a palindrome. If the number is XXXXX five digits long, display an error message dialog indicating the problem to the user. When the user dismisses the error dialog, allow the user to enter a new value.
  9. Your program will have the following four methods:
  10. main() method, which controls the execution of the program
  11. retrieveInput() method, which prompts and retrieves the input values
  12. check() method, which determines whether it is a palindrome
  13. display() method, which displays the result.
  14. STEP 3: Diamond
  15. Write a program called Diamond.java that uses a method diamondOfAsterisks() that displays a diamond (the row number of a diamond must be odd) of asterisks whose row is specified in an integer parameter row. For example, if row is 7, the method displays the pattern of asterisks at the top of the next page. It needs to be centered!!
  16. *
  17. ***
  18. *****
  19. *******
  20. *****
  21. ***
  22. *
  23.  
  24. Download: http://solutionzip.com/downloads/largest-palindrome-diamond-java/
Advertisement
Add Comment
Please, Sign In to add comment