Question: Do the following. ( 5 pts ) . a . Declare a variable and initialize it to a boolean value. b . Declare another variable

Do the following. (5 pts).
a. Declare a variable and initialize it to a boolean value.
b. Declare another variable and initialize it to an integer value.
c. Declare the third variable and initialize it to a float.
d. Convert your float value to an integer and print it.
e. Declare a variable of type byte and store your integer value (b) in it. Print the byte value. (Use bin() to preserve the binary representation inside print() function)
4. Obtain the operation results of the following expressions. Show your solution for each expression result (10 pts).
a.8%3+6-(5%8)/4*2
b.33-8%3*6/2+22
c.(3+4*8/4%10)+(-3*5+18/4*(2*3+2))*5
d.3*(2-5*(44%(8+5)-20)-8*2/4)-33
e.88%(4*5+(16-(3*5)+1))-4+16
5. Obtain the operation results of the following expressions. Show your solution for each expression result (10 pts).
a.55<<2 in binary representation.
b.33>>5
c.(3%2)+8>=(5+(8%3-2)+4) or (66-(4*8+5%10)%3)<=(4%2+5*2-8)
d.88%(5*3-12+6*(4%3*4+4))==37 and (40/10*(3/2*2)>12*3/(25%8)*3)
e. int(28+5*3/(5%2)*(44+8%(66%6+10)))<<4
6. Obtain the operation results of the following expressions. Show your solution for each expression result (15 pts).
a.8 & 4 in binary
b.22|7 & 6*(4**2|7) & 6
c.0b010101<<2|0b101010>>2 & (3%2<<2*(8%5>>3-2)+4) in binary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!