- #1
zzoo4
- 42
- 0
I got my old tests back today. And I don't understand what i did wrong??
p.s. teacher is not available at the moment( sub//part time teacher).
1. How much memory does it take to hold a 512x512 color image with 256 different levels of color(states)??
Okay, this one I just guessed and divided 8bits by 262144 which is totally wrong..
2a. what values of x will cause the following to be true??
if(x<100 && x>0 && x%2==1) for this i put 99..
b. if (x>=0 && x%5==0) for this i put 5.
c. if (Math.sqrt(x))%1 == 1 && x>1 && x<50 ) i put 12.25 (okay obviously this is wrong).
3. Create an example of short-circuit evaluation with an || (OR) statement = include variable with explanation.
i put if ((x==y) || (y==x) b/c if one condition is true, the other one must be true.
4. Create an example of a short-circuit evaluation with an && (AND) statement. Include values and explanation.
i put if ((x!=y) || (y=x) b/c only one condition needs to be false , then other is false.
help me fix what I did wrong please?
p.s. teacher is not available at the moment( sub//part time teacher).
1. How much memory does it take to hold a 512x512 color image with 256 different levels of color(states)??
Okay, this one I just guessed and divided 8bits by 262144 which is totally wrong..
2a. what values of x will cause the following to be true??
if(x<100 && x>0 && x%2==1) for this i put 99..
b. if (x>=0 && x%5==0) for this i put 5.
c. if (Math.sqrt(x))%1 == 1 && x>1 && x<50 ) i put 12.25 (okay obviously this is wrong).
3. Create an example of short-circuit evaluation with an || (OR) statement = include variable with explanation.
i put if ((x==y) || (y==x) b/c if one condition is true, the other one must be true.
4. Create an example of a short-circuit evaluation with an && (AND) statement. Include values and explanation.
i put if ((x!=y) || (y=x) b/c only one condition needs to be false , then other is false.
help me fix what I did wrong please?