112k views
5 votes
6. Write statements using combined assignment operators to perform the following: a) Add 6 to x. b) Subtract 4 from amount. c) Multiply y by 4. d) Divide total by 27. e) Store in x the remainder of x divided by 7. f) Add y * 5 to x. g) Subtract discount times 4 from total. h) Multiply increase by sales Rep times 5. i) Divide profit by shares minus 1000.

User HTU
by
5.5k points

1 Answer

5 votes

Answer:

a) Add 6 to x. 6 + x

b) Subtract 4 from amount. 2 + x = y

c) Multiply y by 4 8 + 4 x

d) Divide total by 27.
((8 + 4x))/(27)

Explanation:

Writing the given statements:

a) Add 6 to x.

Adding 6 to x , we get: 6 + x

Result = 6 + x

b) Subtract 4 from amount.

Subtracting 4 from R, we get:

R - 4 = ( 6 + x) - 4 = 6+ x - 4 = 2 + x

Result = 2 + x = y

c) Multiply y by 4

Multiplying y = (2 +x) by 4, we get:

Result = 4 ( 2 + x) = 4(2) + 4(x) = 8 + 4 x

or, Result = 8 + 4 x

d) Divide total by 27.

Dividing total by 27, we get:
((8 + 4x))/(27)

User Roizpi
by
5.2k points