How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Russell H. Your Own Question
Russell H.
Russell H., Programmer & Coder
Category: Programming
Satisfied Customers: 10493
Experience:  Programmer & Coder
13568747
Type Your Programming Question Here...
Russell H. is online now
A new question is answered every 9 seconds

Write Assignment Statements That Perform The Following

Resolved Question:

3.   Write assignment statements that perform the following operations with the variables a, b, and c.
a. Adds 2 to a and stores the result in b
b. Multiplies b times 4 and stores the result in a
c. Divides a by 3.14 and stores the result in b
d. Subtracts 8 from b and stores the result in a

Submitted: 8 years ago.
Category: Programming
Expert:  Russell H. replied 8 years ago.

Assignment statements that perform operations with the variables a, b, and c* (*Actually none of these operations involves the variable c at all... is this an error, or a 'trick answer'?):

b = a + 2

a = b * 4

b = a / 3.14

a = b - 8

(PS: In some coding systems there would be a semicolon; at the end of each of these, e.g. a = b - 8; for the last one.)

If there is anything wrong with them, please let me know and I'll correct the error.

Russell H. and other Programming Specialists are ready to help you

Related Programming Questions