Click here to Skip to main content
15,912,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HRGN points Pin
Naveen26-Mar-08 17:42
Naveen26-Mar-08 17:42 
GeneralRe: HRGN points Pin
rp_suman26-Mar-08 19:20
rp_suman26-Mar-08 19:20 
QuestionEncryption-Decryption Pin
Bram van Kampen26-Mar-08 14:26
Bram van Kampen26-Mar-08 14:26 
GeneralRe: Encryption-Decryption Pin
Mark Salsbery27-Mar-08 7:00
Mark Salsbery27-Mar-08 7:00 
AnswerRe: Encryption-Decryption Pin
Bram van Kampen28-Mar-08 16:56
Bram van Kampen28-Mar-08 16:56 
QuestionNeed help using Adobe "ConvertToPDFandEmail" macro Pin
dean935926-Mar-08 13:23
dean935926-Mar-08 13:23 
GeneralNever Mind ... Re: Need help using Adobe "ConvertToPDFandEmail" macro Pin
dean935926-Mar-08 14:21
dean935926-Mar-08 14:21 
QuestionHelp with hangman controller. Pin
djrasa26-Mar-08 9:46
djrasa26-Mar-08 9:46 
I have to create a class called controller. I do not know what I need to include in this class: attributes and methods/getters/setters/operations?????? I understand the other classes involved in hangman, but not this one?????


Demonstrate the use of a class. It is strongly recommended that you choose a class to implement from the Hangman Tutorial, such as the Controller class.


Class must have a constructor.
Class must have two class member variables of different data types and getters and setters to access these variables.
Program must have 3 files, one header file, one .cpp file for that class and one Main.cpp.

#ifndef CONTROLLER_H

#define CONTROLLER _H

#include <string>

using namespace std;

class Controller

{

private:

string filename; // stores name of file where words are stored

// Add other member variables here

public:

Controller();

void start();

// Add accessor and mutator methods here for your member values

};

#endif // CONTROLLER_H

Now add the source file (Controller.cpp) & code the constructor.

#include "Controller.h"

Controller::Controller(string filename)

{

cout << "Inside the Controller Default Constructor << endl;

}

// Finish implementing methods here

First compile and execute the project to make sure you have typed everything correctly. Then modify your main() function to access your Controller class and use all methods.

Here is an example main() function*:

int main(int argc, char *argv[])

{

Controller controller;

// Call accessor and mutator methods for setting filename

// Start the game

return 0;

}


The Menu is not part of the actual hangman game itself, but rather allows us to add words to the game, play the game, and exit so it is a good candidate for its own class. The game itself can be a separate class so that we are not writing all of the code in main(). As a matter of a fact, let's plan on having very little code in main(), and let a separate class manage the interactions between the menu, game and the dictionary. We will call this class "Controller".
GeneralRe: Help with hangman controller. Pin
David Crow26-Mar-08 9:51
David Crow26-Mar-08 9:51 
QuestionRe: Help with hangman controller. Pin
djrasa26-Mar-08 14:32
djrasa26-Mar-08 14:32 
GeneralRe: Help with hangman controller. Pin
David Crow26-Mar-08 17:13
David Crow26-Mar-08 17:13 
QuestionRe: Help with hangman controller. Pin
djrasa27-Mar-08 4:35
djrasa27-Mar-08 4:35 
GeneralRe: Help with hangman controller. Pin
Member 75496027-Mar-08 5:01
Member 75496027-Mar-08 5:01 
QuestionRe: Help with hangman controller. Pin
djrasa27-Mar-08 7:55
djrasa27-Mar-08 7:55 
GeneralRe: Help with hangman controller. Pin
Member 75496027-Mar-08 8:35
Member 75496027-Mar-08 8:35 
QuestionRe: Help with hangman controller. Pin
djrasa28-Mar-08 9:41
djrasa28-Mar-08 9:41 
GeneralRe: Help with hangman controller. Pin
djrasa28-Mar-08 10:13
djrasa28-Mar-08 10:13 
GeneralRe: Help with hangman controller. Pin
djrasa28-Mar-08 10:14
djrasa28-Mar-08 10:14 
GeneralRe: Help with hangman controller. Pin
led mike26-Mar-08 9:52
led mike26-Mar-08 9:52 
GeneralException when assigning char * to CString Pin
habs26-Mar-08 8:46
habs26-Mar-08 8:46 
GeneralRe: Exception when assigning char * to CString Pin
Mark Salsbery26-Mar-08 9:39
Mark Salsbery26-Mar-08 9:39 
GeneralRe: Exception when assigning char * to CString Pin
led mike26-Mar-08 9:48
led mike26-Mar-08 9:48 
GeneralRe: Exception when assigning char * to CString Pin
David Crow26-Mar-08 9:53
David Crow26-Mar-08 9:53 
GeneralRe: Exception when assigning char * to CString Pin
led mike26-Mar-08 10:19
led mike26-Mar-08 10:19 
GeneralWrong forum. Pin
CPallini26-Mar-08 22:48
mveCPallini26-Mar-08 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.