Find Jobs
Hire Freelancers

DICE PROGRAM C++ / HELP!

$30-100 USD

Completed
Posted almost 20 years ago

$30-100 USD

Paid on delivery
You are to implement the class DieType as per the header file **dietype.h** that is furnished for you. *Do not change **dietype.h**;* just write the function definitions in a file **dietype.cpp.** Your main program should first (and repeatedly) present the user with the prompt: 1. Roll to test dice features. 2. Play me for cash. 3. Quit. Ifthe user chooses (3), the program should end. If the user chooses (1), the following would be a typical exchange: How many dice would you like to roll (up to 6)? 3 *** ** **** Die 1 is greater than Die 2. Die 2 is less than Die 3. A complete and correct version of the program that implements the class and menu options (1) and (3) is worth up to 75% of the credit for the project. For full credit, implement menu option (2) as follows: I will give you 5-1 odds for one die, 10-1 odds for two dice, and 15-1 odds for three dice. You win if you guess the total; you get back your bet if any two dice have the same value. How many would you like to roll? 2 Choose your number: 5 *** **** Sorry, you lose. You owe $1. Play again (y/n)? Y Choose your number: 7 **** **** No winner. You owe $1. Play again (y/n?) y Choose your number: 8 ***** *** You win $10. You're up $9. Play again (y/n)? no Please see the big guy out back to collect your $9. Bye! 1. Roll to test dice features. 2. Play me for cash. 3. Quit. Your program should: * Correctly solve the problem as stated, formatted as shown. * Use an array of DieType objects to represent multiple dice. * Correctly detect input that is outside of the acceptable range. * Make appropriate use of functions. * Use appropriate control structures (selection and/or looping). * Have suitable top-of-file comments (Your name, the class, the assignment, the date, a one-sentence description of the function of the program * Use named constants as appropriate. * Have well-chosen variable/constant names. * Use consistent typography and indentation to be neat and easily read. ## Deliverables Pseudocode sketch of solution. Source code. Please follow the specifications and do not make the code too complicated. this is the header: header file: const int DIE_SIDES = 6; class DieType { public: int GetSpots() const; // return current number of spots up int Roll(); // roll the die, return the number of spots up void PrintSpots() const; // print a row of asterisks, one per spot bool Equal(DieType d) const; // return true if equal spots to die d bool LessThan(DieType d) const; // return true if fewer spots than die d DieType(); // default constructor private: int spotsUp; // number of spots on side currently up bool beenRolled; // initially false, true once has been rolled }; ## Platform PC Windows.
Project ID: 3259950

About the project

5 proposals
Remote project
Active 20 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$17 USD in 3 days
5.0 (14 reviews)
3.0
3.0
5 freelancers are bidding on average $29 USD for this job
User Avatar
See private message.
$55.25 USD in 3 days
5.0 (137 reviews)
6.2
6.2
User Avatar
See private message.
$42.50 USD in 3 days
5.0 (51 reviews)
5.3
5.3
User Avatar
See private message.
$17 USD in 3 days
5.0 (221 reviews)
5.2
5.2
User Avatar
See private message.
$11.90 USD in 3 days
5.0 (29 reviews)
3.5
3.5

About the client

Flag of UNITED STATES
United States
0.0
0
Member since Jun 25, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.