Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.18 KB

commands-worksheet.md

File metadata and controls

43 lines (35 loc) · 1.18 KB

Consider the following variable assignments:

d = 10
e = 5.0
f = 2
g = 11.0
h = 3
i = 1.5
Op Result Data Type
d + e evaluates to
f + h evaluates to
g + h evaluates to
d - f evaluates to
g - e evaluates to
(h + i) - f evaluates to
(d - f) + e evaluates to

Multiplication and Division ( *, / )

Op Result Data Type
d * f evaluates to
g * i evaluates to
f * g evaluates to
d / f evaluates to
d / e evaluates to
e / f evaluates to
(g * f) / f evaluates to
(d / f) * e evaluates to
21 / 5 evaluates to

Overall:

  1. Give two different ways to add 1 to the variable y and store that result in the variable y.
  2. Give two different ways for multiplying the variable x and the variable y and storing the result in x.
  3. Give two different ways for dividing the variable y by 8, multiplying that result by z, and then storing the final result in z.
  4. Give an example of an invalid assignment statement.