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";
}
} 

Recommended Answers

All 2 Replies

getting many errors

What are the errors? Oh, and moved.

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..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.