05-13-2011 09:30 PM
Hi all,
I am currently developing a small program.
The inputs are 3 values(integers) : x, y, z
How do I design the program to determine: "Is there any value LESS than 25% of the HIGHEST value?", if yes, exclude that value.
Kind Regards,
Adrian
Solved! Go to Solution.
05-13-2011 10:44 PM
What do you mean by "exclude that value"? What do you want to do with values that are not "excluded"? Do you want place the values into an array?
Build the 3 values into an array. Find the Maximum of the array. (Array palette). Take 25% of that number and compare it to the elements of the array.
05-13-2011 11:37 PM
Hi,
I am using those 3 values for a multiply calculation.
However, the initial condition is that, if a value is less than 25% of the highest value, I have to create an option to allow user to exclude it from the calculation (Hence, only 2 values multiply).
I have put those 3 values into an array, and using Max & min, I know which one is the max, and multiply that by 0.25, and now I am stuck how to build it.
05-14-2011 12:10 AM - edited 05-14-2011 12:12 AM
Adi_1017 wrote:However, the initial condition is that, if a value is less than 25% of the highest value, I have to create an option to allow user to exclude it from the calculation (Hence, only 2 values multiply).
This is not general enough! What if 2 values are less than 25%?
Should these values be excluded automatically or how should the options be presented to the user?
What kind of output do you want?
Here is some simple code that create an output array containing only the elements that are greater than 25% of the highest value. Modify as needed.