subject

C++ Please do not solve if you do not understand.
I have included Die. h and Die. cpp
Complete each section:
Header comments
HEADER FILES (include toolkit, Die. h, and any other header files needed)
ABSTRACT DATA TYPES (none required)
GLOBAL CONSTANTS (none required)
PROTOTYPES (none required)
MAIN PROGRAM
Display hello message
Create a pointer to a dynamically allocated Die object with 8 sides
Display number of sides and the rolled value for the die
Release memory for Die object and set pointer to nullptr
Display goodbye message
DEFINITIONS (none required)

//Die. h
#ifndef DIE_H
#include
using namespace std;
//Die class
class Die
{
private:
int sides;
public:
Die();
Die(int s);
void setSides(int s);
int getSides();
int roll();
~Die();
};
#endif DIE_H

//Die class implementation file
//Die. cpp
#include
#include
#include
#include "Die. h"
using namespace std;
//Default constructor
Die::Die()
{
srand(time(0));
sides=0;
}
//Parameter constructor
Die::Die(int s)
{
srand(time(0));
sides=s;
}
//Function setSides
void Die::setSides(int s)
{
sides=s;
}
//Function getSides
int Die::getSides()
{
return sides;
}
//roll function
int Die::roll()
{
if(sides<=0)
return 0;
return rand()%sides+1;
}
//Destructor
Die::~Die()
{
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Norder to receive financial aid at his vocational school, mario must fill out the fafsa. the fafsa is a form that must be completed to determine . in order to complete a fafsa, you must submit . the fafsa can students obtain
Answers: 2
question
Computers and Technology, 24.06.2019 15:50
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
question
Computers and Technology, 24.06.2019 21:40
is on drugs i swear i ask a question and its not showing whats going
Answers: 2
You know the right answer?
C++ Please do not solve if you do not understand.
I have included Die. h and Die. cpp
C...
Questions
Questions on the website: 13722367