Closed roniragilimankhoirul closed 10 months ago
Congratulations π @roniragilimankhoirul on your contribution. Thanks for adding value to this repository. π
Let's celebrate this fest π by providing more developers π¨βπ»π©βπ» an opportunity to contribute. Help us make this repository reach far and more by sharing this to your friends and colleagues.
@roniragilimankhoirul, Well explained logic. Adding admin-appreciation points for the same. ππ
Issue Id you have worked upon -
471
Briefly explain your program logic -
age
is empty or not a positive integer. If it's not a valid input, it sets theerror
state and returns the error message "Please enter a valid age (use numbers only)."ageInMonths
based on the selectedageUnit
(months or years). IfageUnit
is in months, it uses the age directly; otherwise, it multiplies the age by 12 to convert it to months.switch
statements to determine the appropriate sleep recommendation based on theageInMonths
orage
andageUnit
. If a valid recommendation is found, it sets theresult
variable to that recommendation. It based on an article from Centers for Disease Control and Preventionresult
variable empty.result
is not empty, and if so, it returns the recommendation. Ifresult
is empty, it returns the message "Age not within the specified range for this group."Screenshots(Attach 2 screenshots of your own input and output) -
By raising this PR I affirm that -
[x] My code follows the guidelines of this project.
[x] I have performed a self-review of my own code.
[x] I have commented my code.
[x] My code gives the correct output.
[x] I affirm that I strictly follow contributing guidelines and code of conduct.