Find Jobs
Hire Freelancers

program for a multidice game in c++

$30-50 USD

Cerrado
Publicado hace más de 21 años

$30-50 USD

Pagado a la entrega
Coursework 1 : Specification This coursework involves creating a class MultiDice that extends the TwoDice class already developed in the lectures. Whereas TwoDice has the two data members dice1 and dice2, an object of this new class will have N data members dice1, dice2, dice3, ... , diceN where N > 0. The constructor of MultiDice will need to include an integer value that specifies how many dice are to be supplied for this object. So, for example, if we require a "5-dice" object for a game such as "Yum" (also known as "Yangtze"), we would simply write: MultiDice t( 5 ) ; and the corresponding object t would have five data members, each of which would be initialised to a random number between 1 and 6. Clearly, the number of dice is not known until run-time, so we are going to have to store a pointer to a dynamically allocated piece of memory which will store the values of the 5 dice. The class definition for MultiDice will therefore take the form: class MultiDice { public: MultiDice( int ) ; // default constructor ... // rest of the class interface private: int* pDice ; // pointer variable int number ; // why is this needed and what is it for? } This coursework is divided into three main parts - the first requires you to produce an interface for MultiDice, along the lines of that for TwoDice together with a corresponding implementation. The second part develops these ideas by getting you to think about alternative formulations of some of the member functions produced in part one. This part also involves the writing of an operation that simulates the re-throwing of an existing MultiDice object and asks you to provide additional member functions of your own. The last part requires you to use your class in an application that simulates the playing of a game of Yum. Part 1 Complete the class definition MultiDice given above by providing a full set of member functions, analogous to those for the class TwoDice developed in the lecture, together with corresponding implementations of these member functions. In particular, you should: Provide an appropriate canonical class form which ensures that an object with two dice is created by default Provide an operation sum( ) that finds the sum of the face values of a MultiDice object Provide an overloaded operator that finds the combined sum of two MultiDice objects Provide a Boolean-valued function, ## Deliverables For this coursework, the following deliverables (documents) must be provided, in this order, when submitting the coursework: the header file MultiDice.h corresponding to Part 1 (a) to (g) inclusive the implementation file [login to view URL] corresponding to Part 1 (a) to (g) inclusive a revised header file MultiDice.h corresponding to Part 2 (h) to (k) inclusive a revised implementation file [login to view URL] corresponding to Part 2 (h) to (k) inclusive a main program that simulates the playing of the game - this should include your global function getHighest( ) output from the main program ## Platform unix or visual c++ 6
ID del proyecto: 2877022

Información sobre el proyecto

27 propuestas
Proyecto remoto
Activo hace 22 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
27 freelancers están ofertando un promedio de $25 USD por este trabajo
Avatar del usuario
See private message.
$42,50 USD en 14 días
4,9 (178 comentarios)
6,8
6,8
Avatar del usuario
See private message.
$34 USD en 14 días
4,8 (43 comentarios)
5,4
5,4
Avatar del usuario
See private message.
$42,50 USD en 14 días
4,4 (72 comentarios)
5,5
5,5
Avatar del usuario
See private message.
$34 USD en 14 días
5,0 (24 comentarios)
5,3
5,3
Avatar del usuario
See private message.
$42,50 USD en 14 días
5,0 (38 comentarios)
4,8
4,8
Avatar del usuario
See private message.
$25,50 USD en 14 días
4,7 (41 comentarios)
4,7
4,7
Avatar del usuario
See private message.
$34 USD en 14 días
4,4 (11 comentarios)
4,7
4,7
Avatar del usuario
See private message.
$21,25 USD en 14 días
5,0 (6 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$42,50 USD en 14 días
4,6 (60 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$3,40 USD en 14 días
4,3 (22 comentarios)
3,4
3,4
Avatar del usuario
See private message.
$25,50 USD en 14 días
5,0 (53 comentarios)
3,3
3,3
Avatar del usuario
See private message.
$8,50 USD en 14 días
5,0 (51 comentarios)
3,2
3,2
Avatar del usuario
See private message.
$21,25 USD en 14 días
4,6 (11 comentarios)
3,1
3,1
Avatar del usuario
See private message.
$34 USD en 14 días
5,0 (7 comentarios)
2,6
2,6
Avatar del usuario
See private message.
$8,08 USD en 14 días
4,5 (18 comentarios)
2,4
2,4
Avatar del usuario
See private message.
$21,24 USD en 14 días
4,3 (9 comentarios)
2,3
2,3
Avatar del usuario
See private message.
$17 USD en 14 días
5,0 (5 comentarios)
1,2
1,2
Avatar del usuario
See private message.
$25,50 USD en 14 días
5,0 (3 comentarios)
0,7
0,7
Avatar del usuario
See private message.
$12,75 USD en 14 días
5,0 (2 comentarios)
0,6
0,6
Avatar del usuario
See private message.
$29,75 USD en 14 días
0,0 (1 comentario)
0,0
0,0

Sobre este cliente

Bandera de UNITED KINGDOM
United Kingdom
0,0
0
Miembro desde oct 16, 2002

Verificación del cliente

Otros trabajos de este cliente

Calorie Counter
$30-5000 USD
¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos 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)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.