CS1121 Programming Assignment 2

# CS1121 Programming Assignment 2 - CS1121 Programming...

• Notes
• 2

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

CS1121 Programming Assignment 2 (7%) [due Mar.2] 1. Write a program that outputs a pyramid of stars with height n, where 1 <= n <= 30. For example, - Input: The height of the pyramid: 4 - Output: * *** ***** ******* 2. Make a Craps Simulator. # Rules * Roll two dice o 7 or 11 on first throw, player wins o 2, 3, or 12 on first throw, player loses o 4, 5, 6, 8, 9, 10 - value becomes player's "point" * Player must roll his point before rolling 7 to win # Use at least one user defined function! ex) int rollDice( void ); #Output Example:

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (Please follow this format!) ./Craps Player rolled 6 + 5 = 11 Player wins ./Craps Player rolled 6 + 6 = 12 Player loses ./Craps Player rolled 4 + 6 = 10 Point is 10 Player rolled 2 + 4 = 6 Player rolled 6 + 5 = 11 Player rolled 3 + 3 = 6 Player rolled 6 + 4 = 10 Player wins ./Craps Player rolled 1 + 3 = 4 Point is 4 Player rolled 1 + 4 = 5 Player rolled 5 + 4 = 9 Player rolled 4 + 6 = 10 Player rolled 6 + 3 = 9 Player rolled 1 + 2 = 3 Player rolled 5 + 2 = 7 Player loses...
View Full Document

• Fall '12
• player

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern