go to previous page   go to home page   go to next page

Answer:

A sentinel controlled loop.


Main Method

flowchart of factorial

A well-organized program divides the different tasks into different modules. Often, the main() method is responsible for user interaction and other I/O. main() calls methods that perform various computations and report back to main().

The flowchart shows this style of organization. The main loop is concerned with repeatedly asking the user for N and calling a static method that calculates N!

The box for calculating factorial shows that it is a method.


QUESTION 4:

What is the parameter of the method that calculates factorial?

What is the return value of the method that calculates factorial?


go to previous page   go to home page   go to next page