Computer Science 252
Problem Solving with Java

Fall 2014, The College of Saint Rose

Lecture 16: Recursion
Date: Tuesday, October 21, 2014


Agenda

Lecture 16 Assignment

Due at the start of class, Thursday, October 23.

Please submit answers to these questions in Submission Box under "LA16" or in hard copy by the start of our next class. We will discuss these questions at the start of class, so no late submissions are accepted. Please be sure that your name is clearly indicated in all submissions.

For this lecture assignment, you will be writing a Java application - a program that is not in a WindowController class but instead has a main method that does its work. It will be similar in structure to the Powers example. Write your program in Factorial.java. As in that example, you will need to create a keyboard Scanner to read in a number from the terminal and use System.out.println to issue a prompt and report your answer.

The problem we are going to solve is that of computing factorials. From math, you know that the factorial of a positive integer n, denoted n!, is the product of all the numbers from 1 up to n.

Terminology

Examples