Computer Science I Onondaga Community Colleye Arith metic Exercises 1. Compute t
ID: 3903698 • Letter: C
Question
Computer Science I Onondaga Community Colleye Arith metic Exercises 1. Compute the value of each legal expression Indicate whether the value is an integer or a (loaing point value. Ir the expression is not legal. explain why. Flot c. 1035 2 5.9333f Lo+ d. 12.5 (2.5 (6.2 3.1)) 13,3 flo+ e. -4 * (-5 +6)-? int (10.0/3.0 2) /34445 FIDH 2. What value is stored into the int variable result in each of the following a. result 15 3 n b. result 73 2: Y33 Uin c. result2 7 5 37ir d. result 45 8 42 u int e" result 17 + (21 % 6) * 2; a3 in f result int (4.52.6 0.5) 5.g 5 1 3. Given he following variahle declarations int 1 4: int 17; float k 2.6 Determine the value of each expression hekow. If the result is a fkoating point value, include a decimal point in yw iswer a. 3 / float (1) b. 1.0 12 c. k 1 e. (12)1 h, 2*3-1%3 j. Determine the value of integer variable x alter each statement is performed. a. x 73 62 1; Int (k 0.5) + 4.Explanation / Answer
since first 2 questions are answered I answered 3rd question:
a. 3/float(i) = float, 0.75
b. 1.0/i+2 = 2.25 = 1/4 + 2 = float, 2.25
c. k*j =2.6 *17 = float, 44.2
d. i + j % 1 = 4+ 17%1 = int, 4
e. (1/2)*i = ½ =0*4 = int 0
f. 2 * i +j – 1 = int 24
g. j/2 = int 8
h. 2 * 3 – 1 % 3 = int 4
i. i * j / I = int 17
j. int(k+0.5) = int 3
Please post the remaining parts as separate questions.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.