EE121_Recitation_2_Fall2024
EE121_Recitation_2_Fall2024
NAMANE
2. Assume that five integers have been properly declared and initialized with the following values:
a =2, b=3, c=9, d=11 and q=7.
What will be the value of E in the following three assignments?
E ← a + b * c – d*q
E ← b * d / q - a +q
E ← - a + b / 2*a
3. What is the value of E in each of the following assignments if we consider that A=3, B=4, X=3.0, Y= -1.0,
C=’K’ and F=False.
E ← -X*A+Y
E ← B-A/Y+2
E ← (4+A*4–B+(A+16))/(Y–9+6*3)
E ← (((B–2)/(Y/3))/2)*((5*X)-16)
E ← F AND NOT (C<’A’)
E ← (X>Y) OR (A>B)
E ← (X≤Y) AND (A<B)
4. Write an algorithm which determines and displays the position (x,y), at any given time t, of a moving particle
in the xy-plane according to the following parametric equations:
𝑥𝑥(𝑡𝑡) = 2𝑡𝑡
� 3𝑡𝑡 2 where x,y are in meters and t in seconds.
𝑦𝑦(𝑡𝑡) = 2 − 4𝑡𝑡