Class Help Needed

Create a class Hangman with the following private attributes:
 Words: should be a static array of character pointers with 5 elements.
 Word Name: should be a pointer to a character.
 Chosen Letters: should be a pointer to a Boolean.
 Letter: should be a character attribute.
 Number of Trials: should be an integer attribute.
 Word Length: should be an integer attribute.
The class Hangman should contain the following behaviors:
 Constructor with no arguments:
o Declare and initialize a random number between 0 and 4.
o Assign Word Length to the length of a text inside Words based on the generated random number.
o Dynamically allocate Word Name and Chosen Letters based on the Word Length.
o Assign Word Name to the chosen random text from Words.
o Set the Number of Trials to 0 and initialize the array Chosen Letters to false.
 Destructor:
o Dynamically de-allocate Word Name and Chosen Letters.
o Print on the screen the value of Word Name with the sentence “has been removed”.
 Constant get function for Number of Trials.
 Check Value:
o The function should not take any parameters.
o If the value of Letter found within the array Word Name, set the same element index of Chosen Letters to true and return true; otherwise return false.
 Word Complete:
o The function should not take any parameters.
o The function must return false if one element inside Chosen Letters is equal to false; otherwise return true.
 Overloaded operators (<<, >>, ++):
o operator<< must output the correct letters on screen; otherwise print an underscore “_”.
o operator>> must input the letter chosen by the user into the attribute Letter.
o operator++ must increment the value of Number of Trials.


[b]i really need help with this anyone[/b]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #ifndef Hangman_H
#define Hangman_H

#include<iostream>
using namespace std;

class Hangman
{
	private:
		static char Words[5];
		char *WordName;
		bool *ChosenLetters;
		char Letter;
		int NumberOfTrials;
		int WordLength;
	
	public:
		Hangman(static char ,char ,bool ,char ,int ,int );
What kind of help do you need with your homework? Currently it seems that the main issue is that you have not written all the code that the instructions tell you to write. That is too generic question for us to answer.
Topic archived. No new replies allowed.