CS1121 Programming Assignment 2

CS1121 Programming Assignment 2 - (Please follow this...

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

View Full Document Right Arrow Icon
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:
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern