Question: Lab Exercise: Write a Java application that performs the following operations based on a user choice: 1. Reverse the digits of a number. 2. Chuck

Lab Exercise: Write a Java application that performs the following operations based on a user choice: 1. Reverse the digits of a number. 2. Chuck if a number is palindrome. ENG-300 Computer Engineering Department 3. Check if a number is a perfect number. 4. Check whether a number is prime of not. 5. Count the number of prime numbers that exist up to a given number. You should implement the following methods reverseDigits: The method takes a number and metums the number after reversing the order of its digits. isPalindrome! The method deter times whether a number is paindrome or not A positive integer is palindrome if its value is the same after reversing the order of the digits in the number. AnPerfect Number: The method de as whether a number is perfect number or not, An integer number is a perfect number if it's factors, Including 1 but not including the number itsell, sum to the number. For example, 6 is perfect number because 6 . 1+ 2+3 IsPrime: The method determines whether a number is prime or not. A positive integer is prime if it is divisible by only 1 and itself count Primes: The method returns the number of prime numbers that exist up to and including a given number. HINT: you can call a method inside another method to avoid using repeated code and take advantage of software inability Sample Quiput Please enter a number: 1- Reverse the digits of a number. 2- Chock if a number is palindress. 3- Check If a number is a perfect number. 4- Check whether a number is prime of not. 5- count the number of prime numbers that exist up to a given number. 6- EXIE Enter your choice: The reversed number is 50321 Please enter a number: 12721 1- Reverse the digits of a number. 2- Chock if a number in palindrome. J- Chack if a number to a perfect surber, 4- Check whether a number is prime of not. 5- Count the number of prime numbers that exist up to a given 6- EXIE Enter your choices 2 The number 12321 is a palindrome
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
