Question: 2 (a) Write a Java program that prompts the user to enter a 5 digit number and check if the inputted number is a palindrome
2 (a) Write a Java program that prompts the user to enter a 5 digit number and check if the inputted number is a palindrome number. The program should ensure the number entered is 5 digits in length. A palindrome number is one that reads the same forward as in reverse, for example, 12321,24442 and 97679 are all examples of 5 digit palindrome numbers. (b) Write a Java program that will: (i): Create a 2D array of a size that is decided by user input - the first inputted number relates to the number of rows and the second inputted number relates to the number of columns. (ii): Get the user to populate the array with integers. (iii): Print the total number of odd numbers in the array. (iv): Calculate the sum of all the odd numbers in the array and print the answer to the screen. (v): Print the contents of the array to the screen with each row printed on a line of its own. Page 2 of 3 January 2019 (v): Determine which row has the largest sum and print this sum to the screen along with the row number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
