title: DeclarationError: Undeclared identifier
body: <p>I am trying to create a token using solidity programming, but I keep getting this undeclared identifier error when I compile on remix browser IDE. I am new to solidity and how can I solve this problem? </p>
  
  <p>I have attached my code here:</p>
  
  <pre><code>pragma solidity &gt;=0.4.16 &lt; 0.6.0;
      /*declare an interfaced named tokenReceipent so that any contract that implements receiveApproval function counts as a tokenReceipent*/
  interface tokenRecipient
      {
           function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
      }
      contract TokenERC20  //create a contract ERC20 and declare public variables of the token
      {
          string public name;
          string public symbol;
          uint8 public decimals = 18;
          uint256 public totalSupply;
          mapping(address =&gt; uint256)public balanceOf; // create mapping with all balances
          mapping(address =&gt; mapping(address =&gt; uint256)) public allowance;
          event Transfer(address indexed from, address indexed to, uint256 value); //create an event on blockchain that will notify clients
          event Approval(address indexed _owner, address indexed _spender, uint256 _value);
          event Burn(address indexed from,uint256 value);  //create an event that notifies clients about the amount burn
          constructor(uint256 initialSupply, string memory tokenName, string memory tokenSymbol) // create a construct that initialized tokens to the creator of the contract
          public
          {
              totalSupply = initialSupply*10** uint256(decimals); //update total supply with des 1 1 out
              balanceOf[msg.sender]=totalSupply;//give creator all initial tokens 
              name=tokenName; //set the name and symbol for display purposes
              symbol=tokenSymbol;
          }
  
          //create an internal function and can only be called by this smartContract
          function _transfer(address _from, address _to, uint _value) internal
          {
              //prevent transfer to 0x0 address
              //check that the balance of the sender has enough
              //add thesame to the recepient
              //insert assert to use static analysis to find bugs in your code,they should never fail
              require(_to!=address(0x0));
              //subtract from the sender
              require(balanceOf[_from]&gt;= _value);
              //add thesame to the receipent
              require(balanceOf[_to] + _value&gt;= balanceOf[_to]);
              uint previousBalances = balanceOf[_from] + balanceOf[_to];
              balanceOf[_from] -= _value;
              balanceOf[_from] += _value;
              emit Transfer(_from , _to, _value);
              //assert are used to find static analysis in your code,they should never fail
              assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
          }
  
          //create to transfer function
          function transfer(address _to, uint256 _value) 
          public returns(bool success)
          {
          _transfer(msg.sender, _to, _value);
          return true;
          }
  
          //create a from transfer function to transfer tokens from other address
  
          function transferFrom(address _from, address _to, uint256 _value) 
          public returns(bool success)
          {
              require(_value &lt;= allowance[_from][msg.sender]);
              allowance[_from][msg.sender] -= _value;
              _transfer(_from, _to, _value);
              return true;
          }
  
          //create allowances for other address
          //allows spender not spend a certain allowance on your behalf
  
          function approveAndCall(address _spender, uint256 _value, bytes memory _extraData)
          public returns(bool success)
          {
              tokenRecipient spender = tokenRecipient(_spender);
              if (approve(_spender, _value)) {
                   spender.receiveApproval(msg.sender, _value, address(this), _extraData);
                   return true;
                  }
          }
          function burn(uint256 _value)
          public returns (bool success)
          {
              require(balanceOf[msg.sender]&gt;= _value);
                  balanceOf[msg.sender] -= _value; //subtract from the sender
                  totalSupply -= _value; //update the total supply of tokens
              emit Burn(msg.sender, _value);
                  return true;
          }
          // function that destroys token from other(users/subscribers) accounts
          function burnFrom(address _from, uint256 _value) 
          public returns(bool success)
          {
              require(balanceOf[_from] &gt;= _value);
              require(_value &lt;= allowance[_from][msg.sender]);
              balanceOf[_from] -= _value;
              allowance[_from][msg.sender] -= _value;
              totalSupply -= _value;
              emit Burn(_from, _value);
          return true;
          }
  
      }
  </code></pre>