Christian F.

asked • 09/21/19

Combined Assignment Operators

This is a silly program to help you practice with combined assignment operators, such as +=. Use ONLY these types of operators as you manipulate the user's lucky number by always using the number 10. See output below for details.

 

Output:

Enter a lucky number (must be whole number) and I will manipulate it using my number:   [assume user inputs 7]

Your lucky number + 10 equals 17

Now I will multiply the previous result by 10, which equals 170

Next I subtract the previous result by 10, which equals 160

Lastly, I divide the previous result by 10, which equals 16

 

Hints and Notes:

1) This is the last time I will give the hint that you need a constant. Should be obvious by now.

2) You must combine the Processing and Output areas. Otherwise, you would need way too many variables and you would ruin the purpose of this exercise.

 


1 Expert Answer

By:

Keith B. answered • 09/22/19

Tutor
4.6 (22)

Software Engineer and Math Geek

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.