Exam2FR

Exam2FR - Fall 2006 COP 3223 Section 1 Exam 2 Free Response...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Fall 2006 COP 3223 Section 1 Exam 2 Free Response Answer Sheet Last Name: ____________ , First Name: _____________ 1) (15 pts) Write a function that calculates and returns n factorial, where n is the input parameter. You may assume that n is guaranteed to be positive. Note that n! = 1x2x3x… xn. (Note: You will get no credit on this question if you put a printf in this function.) Please fill out the function definition provided below: int factorial(int n) { } 2) (15 pts) Complete the program below so that it reads in individual characters until EOF is encountered and for each letter outputs its mirror letter. For each non-letter the same character is outputted. (Note: The mirror letter for 'a' is 'z'; the mirror letter for 'b' is 'y'; etc.) #include <stdio.h> #include <ctype.h> int main() { return 0; }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3) (10 pts) Chips at a casino cost $7. Typically, a gambler will give the house all of his/her cash, and the house will give the gambler as many chips as the chips can buy, plus the remaining cash back. For example, if a gambler gave the house $25, then he would
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Exam2FR - Fall 2006 COP 3223 Section 1 Exam 2 Free Response...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online