Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

What are the attributes of a technical decision?

Answered: 1 week ago

Question

How do the two components of this theory work together?

Answered: 1 week ago