Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide the java code for the above question. Please dont post the code as images. 1 Create an interface Advance Calculator with the below

image text in transcribedimage text in transcribed

Please provide the java code for the above question. Please dont post the code as images.

1 Create an interface Advance Calculator with the below methods. 1. int crosssum(int a) - To add the digits of given number 2. boolean checkPrime(int a) - To check whether the given number is prime or not 3. int factorial(int a) - To calculate the factorial value Create a class Calculator and implement the Advance Calculator. Get one input from the user and check whether the given number is a prime number or not, calculate the factorial value of the given number and find the sum of digits of the factorial result. Input Format The input consists of an Integer Output Format Prime number or Not prime number Factorial value of the given number Sum of digits of factorial result Sample Testcases Testcase 1 Input Testcase 1 Output Prime number 120 Testcase 2 Input Testcase 2 Output Not prime number 24

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions