nus-cs2113-AY2223S1 / pe-dev-response

0 stars 0 forks source link

View BMI command gives nonsensical data when biometric data is not set #1031

Open nus-pe-bot opened 1 year ago

nus-pe-bot commented 1 year ago

The "view bmi" command does not check whether a height has actually been input by the user before performing the calculation for BMI, leading to strange output:

-------------------------------------------------------------------------------
add weight /1 /1 /12-12-0001
-------------------------------------------------------------------------------
Weight: 1kg
Fat percentage: 1%
Date: 12-12-0001
 Weight and fat percentage are recorded successfully
-------------------------------------------------------------------------------
view biometrics
-------------------------------------------------------------------------------
Biometrics:
Biometrics are not set
-------------------------------------------------------------------------------
view bmi
-------------------------------------------------------------------------------
Your current BMI is : 9.223372036854776E16
Re-check your height and weight inputs. Your BMI is astonishingly high.
-------------------------------------------------------------------------------

To allay user confusion, it is best to detect this particular case and alert the user accordingly.


[original: nus-cs2113-AY2223S1/pe-interim#1022] [original labels: severity.Low type.FunctionalityBug]

gaoyunfan commented 1 year ago

Team's Response

No details provided by team.

Duplicate status (if any):

--