Find Jobs
Hire Freelancers

DICE PROGRAM C++ / HELP!

$30-100 USD

Concluído
Publicado há quase 20 anos

$30-100 USD

Pago na entrega
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.
ID do Projeto: 3259950

Sobre o projeto

5 propostas
Projeto remoto
Ativo há 20 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$17 USD em 3 dias
5,0 (14 avaliações)
3,0
3,0
5 freelancers estão ofertando em média $29 USD for esse trabalho
Avatar do Usuário
See private message.
$55,25 USD em 3 dias
5,0 (137 avaliações)
6,2
6,2
Avatar do Usuário
See private message.
$42,50 USD em 3 dias
5,0 (51 avaliações)
5,3
5,3
Avatar do Usuário
See private message.
$17 USD em 3 dias
5,0 (221 avaliações)
5,2
5,2
Avatar do Usuário
See private message.
$11,90 USD em 3 dias
5,0 (29 avaliações)
3,5
3,5

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
0,0
0
Membro desde jun. 25, 2004

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.