The question is to test an evaporator containing an aromatic agent to see its service life. We know the size of the evaporator content (ml for calculation). The fragrance in it will evaporate a certain percentage (evap_per_day) every day ). The question is to test an evaporator containing an aromatic agent to see its service life.
We know the size of the evaporator content (ml for calculation). The fragrance in it will evaporate a certain percentage (evap_per_day) every day ).
This evaporator requires at least threshold (percentage) fragrance, otherwise it will no longer be used.
All numbers are positive.
After how many days, the evaporator will expire.
The function prototype is as follows:
Function evaporator (content, evap_per_day, threshold)
The parameters are capacity, volatile percentage, and minimum percentage.
In fact, it doesn't matter if you don't need the capacity. You can also use the percentage to solve this problem, but I think it is better to understand the capacity.
The following is the capacity solution, which determines the remaining capacity after daily volatilization until the current capacity is less than the minimum limit capacity, and returns the number of days.
Function evaporator (content, evap_per_day, threshold) {var day = 0; threshold = content * threshold/100; while (content> = threshold) {content * = (1-evap_per_day/100); day ++;} return day ;}
The above is the JavaScript interesting question: the content of the fragrance evaporator. For more information, please follow the PHP Chinese Network (www.php1.cn )!