whatsapp

Connect on Whatsapp : +1 206 673 2541, Get Homework Help 24x7, 100% Confidential. Connect Now

Design and implement a procedure named reversefactorial

Design and implement a procedure named reverseFactorial. This procedure should take one

integer parameter x. When x is a positive integer, this procedure should return the smallest positive

integer n for which n! (i.e. 1*2*3*…*n) is greater than or equal to x. For example:

reverseFactorial(24) should return 4 since (1*2*3*4) = 24 but (1*2*3) < 24;

reverseFactorial(119) should return 5 since (1*2*3*4*5) > 119 but (1*2*3*4) < 119.

//Requires: None

//Modifies: None

//Effects: Returns the smallest positive integer n for which n!

// (i.e. 1*2*3*…*n) is greater than or equal to x, for positive

// integer x. Otherwise returns 1.

public static int reverseFactorial(int x) {

//write the code here}

Get FREE Essay Price Quote
Pages (550 words)
Approximate price: -