Question: in java COMP 167 - Lab 2 User defined methods Program 1: Write a program to verify whether a string is palindrome or not Example:
COMP 167 - Lab 2 User defined methods Program 1: Write a program to verify whether a string is palindrome or not Example: 121 is a palindrome, 123454321 is a palindrome, 13478 is not a palindrome. Algorithm Program 2: Variation of Program 1: Verify whether a string is palindrome. Write a user defined method reverse for the logic of reversing string. String methods you can use: equalso shatto, length Algorithm Program 3: Write a user defined method to calculate factorial of a number. Factorial: Factorial of a number x =x*x-1*x-2*....+1 Factorial of 3 = 3*2*1=6 Factorial of 7 = 7*6*5*4*3*2*1 = 5040 Algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
