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 10:00
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 22.06.2019 11:50
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
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
Biology, 17.10.2019 05:40
question
Social Studies, 17.10.2019 05:40
Questions on the website: 13722361