jamesy961 jamesy961
  • 23-02-2017
  • Computers and Technology
contestada

I'm stuck on this problem and how do I test the program with the arguments.

Im stuck on this problem and how do I test the program with the arguments class=

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 24-02-2017
The basic processing would be:

int factorial = 1;
while( N > 0 )
{
       factorial *= N;
       N--;
}

system.out.println( args[1] + "! is " + factorial );

It's kind of funny that the example run in your image has the wrong answer.
Answer Link

Otras preguntas

can someone help me with these 2 questions?
As a rocket ascends, its acceleration increases even though the net force on it stays constant. why? (assume a traveling distance small enough that the thrust,
Accommodation of the eye refers to its ability to __________.
A 71-year-old patient with eskd has been told by the physician that it is time to consider hemodialysis until a transplant can be found. the patient tells the n
Winston Churchill referred to the spread of communism as this?
What can the reader conclude about children based on these two passages? A) children swallow foreign objects because their siblings dared them. B) children ofte
what dose the separation of powers mean
Light travels at 3.0 x 108 km/s. How far does light travel in 5 minutes? A) 1.5 x 1010 km B) 1.5 x 1011 km C) 9.0 x 109 km D) 9.0 x 1010 km
Maria and jacob want to have their own biological children but cannot. they are _______________ individuals.
Authors like W. E. B. DuBois and Booker T. Washington wrote about their experiences to expose A. racial injustice in the post-Civil War era. B. feminine inequal