Computer Science, asked by moon8577, 5 hours ago

Write a Menu driven program (using switch case ) to carry out the follwing task as per the user’s choice. Appropriate user defined function must be called in each choice.

The program should display the following list of options (Menu)

List Of Options
1. Check for Palindrome Number
2. Check for Special Number
3. Check for Magic Number
4. Check for Armstrong Number

Choice 1 : When the first option is selected, the program should call the function:
public static void palindrome(int n)
The function displays, if the number is palindrome or not
A number is said to be a Palindrome number if the number and its reverse are equal.

Choice 2 : When the second option is selected, the program should call the function:
public static void special(int n)
The function displays, if the number is special number or not
A number is said to be a Special number if the sum of the factorial of the digits is equal
to the number or not.
Example : If the number N = 145 then S = 1! + 4! + 5! = 145
( ! represents factorial)

Choice 3 : When the third option is selected, the program should call the funtion
public static void magic(int n)
The function displays, if the number is a Magic number or not
A number is said to be a magic number if after the repeated addition of its digits, we obtain
the result 1.
Example : If the number N = 82 then 8 + 2 = 10 = 1 + 0 = 1

Choice 4 : When the fourth option is selected, the program should call the function:
public static void armstrong(int n)
The function displays, if the number is an Armstrong number or not
A number is said to be an Armstrong number if the sum of the cubes of its digit is equal to
the number.
Example : If the number N = 153 then S = 1^3 + 5^3 + 3^3 = 153

Write a suitable main() to display the menu and call the appropriate function as per the user’s
choice.​

Answers

Answered by aayushupadhyay46
0

Answer:

I will tell you answer but now Mark me as Brainlist

Answered by gayenbanasree
0

Answer:

MARK BRAINLIEST

Explanation:

(a) To print the series:

0, 3, 8, 15, 24, ………… to n terms. (value of 'n' is to be an input by the user)

(b) To find the sum of the series:

S = (1/2) + (3/4) + (5/6) + (7/8) + ……….. + (19/20)

Similar questions