Results 1 to 2 of 2
  1. #1
    dandaryll is offline Member
    Join Date
    Feb 2017
    Posts
    2
    Rep Power
    0

    Question Need help on algorithm for making recommendations after calories has been calculated-

    Need help on algorithm for making recommendations after calories has been calculated based on person bio info (i.e. age, height, weight etc.)
    so far I have this but please read FIXME
    Java Code:
    public String recommendations() {
      double goalForStatusTest = calculateCalories(userData.weights, userData.height, userData.age, userData.gender, userData.activityLevel);
      String text = "";
        // FIXME: 2000 cannot be goalForStatusTest because same variable cannot be compared
        if (goalForStatusTest >= 1800 && goalForStatusTest < 2000) {
          text = "Good";
        }
        else if  (goalForStatusTest >= 1500) {
          text = "Medium";
        }
        else if (goalForStatusTest >= 1200 || goalForStatusTest < 1200) {
          text = "Bad";
        }
    
        return text;
    }
    Any ideas how to proceed I am stuck at this point? Basically I need an algorithm or formula that can make recommendations based on the calories that are given and calculated already at a different method.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Need help on algorithm for making recommendations after calories has been calcula

    It doesn't bode well that you abandoned the first thread you started.

    https://www.java-forums.org/new-java...tml#post416709

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. How is hashcode calculated?
    By suhaas.mohandos@gmail.com in forum New To Java
    Replies: 32
    Last Post: 08-09-2013, 11:14 AM
  2. User inputs string to get calculated output
    By freky8ss in forum New To Java
    Replies: 2
    Last Post: 05-02-2013, 06:09 AM
  3. Replies: 5
    Last Post: 10-09-2010, 05:22 AM
  4. Help with making this algorithm better
    By RLRExtra in forum New To Java
    Replies: 6
    Last Post: 01-17-2008, 04:11 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •