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, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
question
Computers and Technology, 24.06.2019 10:10
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
How many types of string types does python support?
Answers: 1
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
question
Mathematics, 12.01.2021 22:40
question
Mathematics, 12.01.2021 22:40
question
Mathematics, 12.01.2021 22:40
question
Mathematics, 12.01.2021 22:40
question
Social Studies, 12.01.2021 22:40
Questions on the website: 13722367