Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS102-03 Programming Assignment #2 DUE: March 24, 2017 by the end of the day (electronic copy) program before Print is due on March 27, 2017

image text in transcribed
image text in transcribed
CS102-03 Programming Assignment #2 DUE: March 24, 2017 by the end of the day (electronic copy) program before Print is due on March 27, 2017 at the beginning of class. Be sure to print your out time to print it during class time. classbegins, you will not have Veryshort description: write a program that allows the user to play the dice game Fifty. More detailed description: Your computer program should allow2players to play the dice game Fifty. The nules for Fifty are as follows: Goal Tho goal of Fiftyisto be the first player to reach S0 points. You get points by rolling Play: The players decide who will be player land who will be player 2. Player goes first. A tuna consists of a player rolling a pair of dice (with the goal of rolling doubles), and scoring the roll as described below, Play continaes with each player taking one roll per tum. The first player to score 50 or more points is declared the winner. scoring All doubles except 3s and 6s score 5 points. Double 6s are worth 25 points. Double 3s wipe out the players entire score, and the player must start again at0.Non-double rolls are 0 The program should allow the users to continue to play the game until they choose to quit. Note: As you are developing and testing your program. might want to make the be sure score something smaller tham 50, such as 10. It can take a while to reach 50 points. Just to change it back to 50 before tuming in the program. To simulate the toll of the dice, the program wast generate a random number from 1 to 6 for c each die. Each of the random uumbersis, the value each die. To generate a random mumber provides the rand() function. However, his function is a pseudo-raadom number generator. The very first time the is called, it will come up with the same number (aot exactly what you want). Therefore, to give the rand faction a different starting point each time, which returns the number of seconds soon the system clock. In other words, do the following at the beginning of your srand((unsigned ytine (NULL) II seed randon function with current time only needs to be done once You need to include std1sb.hGe. inelude cstdlib.h 1o use the rando) and srand() functions and tine h the tine fanctiea

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

1. Prepare a flowchart of Dr. Mahalees service encounters.

Answered: 1 week ago