ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 12 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 11 May 2017 My Price 8.00

Write a java program that use the factorial recursive method

Using Java....

1: Write a java program that use the factorial recursive method to

A) Accept factorial number from keyboard.

B) Validate the input. Reject the invalid input until the input is accepted. (Reject input if it is character or string)

C) Use recursive call to calculate the factorial value.

D) Print the result

E) Accept the next number until terminated by user. (enter 0)

*** Write a class object to do the factorial calculation instead of method in the main program. ***

2: Do the similar program for power function by using two recursive methods. Compare two methods we addressed in the lecture. (display the CPU time for both methods)

3: The “odd/even factorial” of a positive integer is represented as n!! and is defined non-recursively as: (n)(n-2)(n-4)…(4)(2) if n is even and is (n)(n-2)(n-4)…(5)(3)(1) if n is odd. For example 7!! Equals 7*5*3*1 or 105 and 6!! Is 6*4*2 or 48. Write a method called oddevenfact that recursively calculates the odd/even factorial value of its single int parameter. The value returned by this method is a long. Validate the input.

*** Write a class object to do the Oddeven factorial calculation instead of method in the main program. **

Answers

(11)
Status NEW Posted 11 May 2017 02:05 AM My Price 8.00

-----------

Not Rated(0)