15a_Assignment_6 - Assignment 6 Gambling with Methods...

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

View Full Document Right Arrow Icon
Assignment 6 - Gambling with Methods Select one option from the four below. All options are worth the same number of points. The more advanced options are provided for students who find the basic ones too easy and want more of a challenge. Make sure you have read and understand the Modules Information About Programming Assignments and Style Rules for Assignments before submitting this assignment. Hand in only one program, please. For this assignment you will have to investigate the use of the C++ random generator function, rand() . Rand() produces a random integer in the range of 0 to RAND_MAX (a constant defined in the stdlib , automatically included in your projects). Among the places you can look for help are the following web sites: http://www.cplusplus.com/ref/cstdlib/rand.html http://www.daniweb.com/tutorials/tutorial1769.html http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_CRT_rand.asp OPTION A (Basic): A Simple Slot Machine The program will loop, asking the user for a bet amount from 0 to 100 (assume dollars, you can use ints or longs ). If the user types a 0 that means he/she wants to quit. Otherwise, accept the amount as their bet and simulates a slot machine pull . Your program will print out a line that looks like a slot machine result containing three strings. Some examples are: BAR 7 BAR , 7 7 cherries , cherries
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.

{[ 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