|
Wyo Java Ch5Proj1 |
|
Write a program that first prompts the user to input a word that is exactly five letters long. The program must display the phrase "palindrome" or "not palindrome" depending on whether the inputed word is the same frontwards as it is backwards. For example, madam is a palindrome while mensa is not. If the inputed word is not exactly five letters long, the program must display "invalid input". Then the program must prompt the user to input a five digit integer. The program must display the phrase "palindrome" or "not palindrome" depending on whether the inputed integer is the same frontwards as it is backwards. For example, 12321 is a palindrome while 12231 is not. The integer must be stored as an int variable and not a String object in this part of the program. Hint: You may want to use the division and/or modulus operators to examine the individual digits of the integer. If the inputed number is not exactly five digits long, the program must display "invalid input". Finally the program must prompt the user to input a hexadecimal number with exactly 3 hexadecimal digits from 0 to F. Your program will display the decimal equivalent and the binary equivalent to the inputed number. If the inputed hexadecimal number is not exactly three digits long, the program must display "invalid input". Do not use loops in this program. Your program must follow the class Coding Standards. Save all of the files associated with this assignment to a folder named Ch5Proj1 in the appropriate network folder. Preconditions:
You must hand in the following on separate pages stapled in this specified order:
|