CISC 105 Lab 04 FAQ

For each of the following questions, I'll give suggestions for "troubleshooting" the problem.

Notes from Sara:

Can we use breaks?

The only time you can use breaks is in switch statements. You CANNOT use breaks in while loops.

Is it okay if we have an extra space at the beginning of the square of asterisks?

Yes, that's okay.

For number 6, is this "void" function the same that we have been using, a.k.a. int main () { }?

No, main is an "int" function. You want to create a function that is of type "void", i.e., it does not return anything. I don't want to say too much, and I probably have already confused you. You may want to wait until after Wednesday's class to do this problem because Terry will cover void functions then.

Problem 7

Several people have asked me about the factorial problem and their trouble with computing the factorial of large numbers. (Do you know what problem they are running into?) The definition of "large" numbers changes if the result is stored in an int, float, or double.

My recommendation: It is reasonable for you to put some restrictions on the input--like that you'll compute factorial for positive integers less than x. But what is the value of x? And, how will you prevent your program from computing the factorial of numbers greater than x?