herbie

herbie

  • NA
  • 14
  • 0

New and not sure what wrong here

May 4 2007 1:42 PM
I get this error when i compile...andy help would be appericated.

'GamePlayers.GameAndPlayers.Game' does not contain a definition for 'ReferenceEqualsnumberPlayers'


using System;

namespace GamePlayers

{

public class GameAndPlayers

{

public static void Main()

{

string enteredGame;

string enteredPlayers;

Game aGame = new Game();

Console.Write("Enter name of the game ");

enteredGame = Console.ReadLine();

Console.Write("Enter the number of players for the game ");

enteredPlayers = Console.ReadLine();

numberPlayers = Convert.ToInt32(enteredPlayers);

Console.WriteLine("The total number of players for the game {0} is {1}",

aGame.GetGameName(),aGame.GetNumPlayers());

}

public class Game

{

public int numberPlayers;

public string gameName;

public int GetNumPlayers()

{

return numberPlayers;

}

public string GetGameName()

{

return gameName;

}

public void SetNumPlayers(int num)

{

numberPlayers = num;

}

public void SetGameName(string name)

{

gameName = name;

}

}

}

}

 

 

 

 

 

 

 


Answers (4)