Are these two testings equivalent from the programming logic point of view?
1)
2)
If not then how to make the second one equivalent to the first one by grouping each respective test from the first two ifs into separate ifs with 2 arguments
Obviously not. Why do you need to write that in another way, your conditions in 1) are logically correct.
Are these two testings equivalent from the programming logic point of view?
1)
2)
If not then how to make the second one equivalent to the first one by grouping each respective test from the first two ifs into separate ifs with 2 arguments
You may find it useful to group the data into a usable collection, such as an array. Then it becomes a little easier working with the data. See, for example, the following code:
int RAIN[9] = {1,2,3,4,5,6,7,8,9}, RAINX[9] = {49,48,47,46,45,44,43,42,41}; bool buy = true; for (int i = 1; i < 9; i++) { if (RAIN[i] > RAIN[i-1] && !(RAINX[i] > RAINX[i-1])) continue; else { buy = false; break; } } if (buy) Print ("BUY!"); else Print ("Do Not Buy!");
You may find it useful to group the data into a usable collection, such as an array. Then it becomes a little easier working with the data. See, for example, the following code:
hMM that looks very useful ty
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Are these two testings equivalent from the programming logic point of view?
1)
2)
If not then how to make the second one equivalent to the first one by grouping each respective test from the first two ifs into separate ifs with 2 arguments