Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (TCO 8) Which of the following data types should be used for number of days i

ID: 1847578 • Letter: 1

Question

1. (TCO 8) Which of the following data types should be used for number of days in a week? (Points : 4)        int
       unsigned int
       char
       unsigned char Question 2. 2. (TCO 8) Find the value for PORTB after the execution of the following code:

                PORTB = 0x66 & 0x99; (Points : 4)        PORTB = 0x09
       PORTB = 0x06
       PORTB = 0x0F
       PORTB = 0x00 Question 3. 3. (TCO 8) Find the value for PORTB after the execution of the following code:

                PORTB = 0x66 | 0x99; (Points : 4)        PORTB = 0x09
       PORTB = 0x06
       PORTB = 0xFF
       PORTB = 0x00 Question 4. 4. (TCO 8) Find the value for PORTB after the execution of the following code:

                PORTB = 0xAA ^ 0xFF; (Points : 4)        PORTB = 0x0A
       PORTB = 0x05
       PORTB = 0x55
       PORTB = 0xFF Question 5. 5. (TCO 8) Assume PORTB has a value of 0xAA. Find the value for PORTB after execution of the following code:

                PORTB = ~PORTB; (Points : 4)        PORTB = 0x55
       PORTB = 0x0A
       PORTB = 0xAA
       PORTB = 0x0 1. (TCO 8) Which of the following data types should be used for number of days in a week? (Points : 4)        int
       unsigned int
       char
       unsigned char

Explanation / Answer

1. unsigned char
2 PORTB = 0x00 (And)
3. PORTB = 0xFF (OR)
4. PORTB = 0x55 (Xor)
5. PORTB = 0x55

Use a Hexdecimal calculator to calculate.