StayFit has been a very successful product among its core users who are now begging for even more functionality. You are being asked to modify your product to start retaining historical data until the program is exited and perform calculations on those historical values. (hint you will need to use data structures such array, arraylist or hashmap)

In the next iteration of the health calculator, in addition to retaining its current ability to perform all the calculation in the table below, it will also output the following for a specific user:

  • Max weight
  • Min weight
  • Average weight

These averages should be printed at the end only when the user elects to exit the program.

Next to the averages, be sure to print out all the values that were used in calculating those averages. Example:

"Your average weight 95lbs is based on the following readings (100, 90,92,97, 96,..)

The program should be able to track and perform calculation for multiple users. If a new user starts using the health calculator without exiting the program should be able to track his data separately from the previous user.

Finally, your StayFit application will be a little smarter and will print a random diet tips for each users after performing calculation. The 5 random diet tips of the day are:

  • "Drink plenty of water"
  • "Eat plenty of fruit and vegetables"
  • "Cut down on alcohol"
  • "Eat Protein at Every Meal"
  • "Exercise routinely"

Men Women
Ideal Body Weight The ideal weight for a man who is exactly 5 feet tall is 106 pounds. For every additional inch above 5 feet, add 6 pounds.

For the individual shorter than 5 feet tall, subtract 2 pounds for each inch under 5 feet
The ideal weight for a woman who is exactly 5 feet tall is 100 pounds. For every additional inch above 5 feet, add five pounds.

For the individual shorter than 5 feet tall, subtract 5 pounds for every inch you measure below 5 feet.
Daily caloric and fat intake If you are completely inactive and do not exercise, multiply your adjusted ideal weight by 11.

If you regularly exercise two to three times per week, multiply your adjusted ideal weight by 13.

If you regularly exercise four to five times a week, multiple your adjusted ideal weight by 15

Finally, if you regularly exercise six to seven times a week, multiply your adjusted ideal weight by 18.
Body Mass Index (Weight lb x 4.88) / (Height ft)2

BMI Classifications
Underweight < 18.5
Normal Weight 18.25 - 24.99
Overweight 25 - 29.99
Obesity > 30
Basal Metabolic Rate BMR = 66 + ( 6.23 x weight in pounds ) + ( 12.7 x height in inches ) - ( 6.8 x age in year ) BMR = 655 + ( 4.35 x weight in pounds ) + ( 4.7 x height in inches ) - ( 4.7 x age in years )
Body Fat Percentage

Adult Body Fat % = (1.20 x BMI) + (0.23 x Age) - (10.8 x gender) - 5.4

Adult Body Fat % = (1.20 x BMI) + (0.23 x Age) - (10.8 x gender) - 5.4

gender = 1 gender = 0
Body Fat Rating Men* Women*
Risky (high body fat) > 30% > 40%
Excess Fat 21 - 30% 31 - 40%
Moderately Lean 13 - 20% 21 - 30%
Lean 9 - 12% 19 - 22%
Ultra Lean 5 - 8% 15 - 18%
Risky (low body fat) < 5% < 15%
Body Adiposity Index Body Adiposity Index BAI = ( HC / (HM)1.5 ) - 18
Where
BAI = Body Adiposity Index
HC = Hip Circumference in Centimeter
HM = Height in Meter
Waist to Hip ratio
Wasit-to-Hip Ratio (WHR) Norms
Gender Excellent Good Average At Risk
Males < 0.85 0.85 - 0.89 0.90 - 0.95 >= 0.95
Females < 0.75 0.75 - 0.79 0.80 - 0.86 >= 0.86

How it works:

Your software will prompt the user for the needed information in order to perform the calculations and present the user with useful information about his/her current health status. The application will perform calculation based on the user's sex and will print user friendly messages next to the calculated number. The calculation will also show the averages/min/max for certain data. In addition the results will include a random diet tip of the day. After printing the calculation results, the application will prompt the user to exit the application or continue using it and will proceed according to the users choice.

Requirement Details:

  • Create a java maven application project called Assignment3
groupId = livewell
artifactId = StayFit
version = 3.0
  • Create a class called StayFitDao in the livewell.dao
    • The StayFitDao class has a list aka (array or arraylist) as a private property that can store each user object.
    • The StayFitDao also has two methods A method that save the user data and another one that retrieves all the data based on a specific username. (hint you will need to now add ask the user to provide you with a username and save in in the user object)
  • Add 3 new methods to StayFitService that takes a list of users and returns respectively, the average weight, the minimum weight, the maximum weight.
  • Extend the StayFitService class by creating StayFitSmartService and give it new added method to print tip of the day.
  • Be creative!
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.