0
public class HealthProfile
{
        private String healthfirstName;
        private String healthlastName;
        private String gender;
        private Float birthday;
        private Float weight;
        private Float height;
        private Double maximumheartrate;
        private Double targetheartrate;
        private Double bmi;

        //starter
        public void setHealthfirstname( String name )
        {
                healthfirstName = firstname;
        }

        public String getHealthfirstname()
        {
                return healthfirstName;
        }

        public void setHealthlastname( String name )
        {
                healthlastName = lastname;
        }

        public String getHealthlastname()
        {
                return healthlastName;
        }

        public void setHealthGender( String name )
        {
                 gender = sex;
        }

        public String getHealthGender( String name )
        {
                return gender;
        }

        public void setBirthdate( float amount )
        {
                birthday = dateofbirth;
        }

        public float getBirthdate()
        {
                return birthday;
        }

        public void setWeight( float amount )
        {
                weight = weight1;
        }

        public float getWeight()
        {
                return weight;
        }

        public void setHeight( float amount )
        {
                height = height1;
        }

        public float getHeight()
        {
                return height;
        }
        public void Age( double amount )
        {
                age = 2010 - birthday;
        }

        public double getAge()
        {
                return age;
        }

        public void MaximumHeartrate( double amount )
        {
                maximumheartrate = 220-birthday;
        }

        public double getMaximumHeartrate()
        {
                return maximumheartrate;
        }

        public void TargetHeartrate( double amount )
        {
                targetheartrate = maximumheartrate/85;
        }

        public double getTargetHeartrate()
        {
                return targetheartrate;
        }

        public void BMI( double amount)
        {
                bmi = (weight * 703) / (height * height);
        }

        public double getBmi()
        {
                return bmi;
        }
}

and here are the errors...PLEASE HELP....

HealthProfile.java:17: cannot find symbol
symbol  : variable firstname
location: class HealthProfile
                healthfirstName = firstname;
                                  ^
HealthProfile.java:27: cannot find symbol
symbol  : variable lastname
location: class HealthProfile
                healthlastName = lastname;
                                 ^
HealthProfile.java:37: cannot find symbol
symbol  : variable sex
location: class HealthProfile
                 gender = sex;
                          ^
HealthProfile.java:47: cannot find symbol
symbol  : variable dateofbirth
location: class HealthProfile
                birthday = dateofbirth; 
                           ^
HealthProfile.java:57: cannot find symbol
symbol  : variable weight1
location: class HealthProfile
                weight = weight1;
                         ^
HealthProfile.java:67: cannot find symbol
symbol  : variable height1
location: class HealthProfile
                height = height1;
                         ^
HealthProfile.java:76: cannot find symbol
symbol  : variable age
location: class HealthProfile
                age = 2010 - birthday;
                ^
HealthProfile.java:81: cannot find symbol
symbol  : variable age
location: class HealthProfile
                return age;
                       ^
HealthProfile.java:86: incompatible types
found   : float
required: java.lang.Double
                maximumheartrate = 220-birthday;
                                      ^
HealthProfile.java:106: incompatible types
found   : float
required: java.lang.Double
                bmi = (weight * 703) / (height * height);

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by coil
0

Please use [code] tags.

Basically, you're using a bunch of variables that don't exist. What's firstName? You haven't declared any of those variables.

The incompatible types errors can be solved by casting the result to a float. If there's no particular reason, you may want to use a double, though.

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.