0

I am trying to creat a profile accourding to user input but getting many errors:
here is my code

public class Profile
    {
    public Profile()
    {
    }
    // method
    public string getMSG()
    {
        return "What do you look like";
    }
        private string _eyecolor;
        public string eyeColor();

            get {return _eyecolor}
            set {
                    if!string.IsNullOrEmpty(value)
                    {
                        _eyecolor=value.substring(0,1).ToUpper() +value.Substring(1);
                    }
                    else
                    {
                        _eycolor=value;
                    }
                }
        }
public string getEyeColor()
{
    return "Eye color: " +_eycolor+"Complexion color:";
}
public string _ccomplexion;
public string cComplexion();
{
return _ccomplexion;
} 
private string _haircolor
public string hairColor
{
get
{return "Hair Color: "+_haircolor+
"Age: ";}
set{_haircolor=value;}
}
private int _age;
public int age
{
get {return _age;}
set {_age=value;}
}
public string getFullProfile()
{
return "For a "_eyecolor+" , "+ _ccomplexion+" and "+ _haircolor+"We suggest the following outfit"+"<br /><br /> "click Here";
}
} 

Edited by pritaeas: Moved

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Mike Askew
Featured Replies
  • public class Profile { public Profile() { } // method public string getMSG() { return "What do you look like"; } private string _eyecolor; public string eyeColor { // Missing this opening bracket for a property get { return _eyecolor; } set { if (!string.IsNullOrEmpty(value)) { _eyecolor = value.Substring(0, 1).ToUpper() … Read More

2
public class Profile
    {
        public Profile()
        {
        }
        // method
        public string getMSG()
        {
            return "What do you look like";
        }

        private string _eyecolor;
        public string eyeColor
        { // Missing this opening bracket for a property
            get { return _eyecolor; }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    _eyecolor = value.Substring(0, 1).ToUpper() + value.Substring(1); // Substring had a small s not S
                }
                else
                {
                    _eyecolor = value; // Typo, _eycolor not _eyecolor
                }
            }
        }

        public string getEyeColor()
        {
            return "Eye color: " + _eyecolor + "Complexion color:"; // Typo, _eycolor not _eyecolor
        }

        public string _ccomplexion;
        public string cComplexion // Again property not setup correctly
        {
            get { return _ccomplexion; } // Added get { }
        }

        private string _haircolor; // Missing semi colon
        public string hairColor
        {
            get
            {
                return "Hair Color: " + _haircolor + "Age: ";
            }
            set { _haircolor = value; }
        }

        private int _age;
        public int age
        {
            get { return _age; }
            set { _age = value; }
        }

        public string getFullProfile()
        {
        return "For a " + _eyecolor + " , "+ _ccomplexion+" and "+ _haircolor+"We suggest the following outfit"+"<br /><br /> " + "click Here"; // Missing " marks and +
        }
    }

All the errors we're completely careless ones that you could of fixed yourself. Most of them were property construction (which you managed to do perfectly once so god knows why the others were wrong) and typos.

Didn't need me to go through that and correct them all..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.