4.2.1: Arithmetic operators. Write a statement that assigns finalValue with the multiplication of value1 and value2. Ex: If value1 is 6 and value2 is 2, finalValue is 12. Note: Your code will be tested with more values for value1 and value2.
Added by Krista D.
Step 1
In this case, we have `value1` and `value2`. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
CHALLENGE ACTIVITY 1.21.2: Writing variables and assignments Write code that assigns numResult with numOne * numTwo. Ex: If numOne is 4 and numTwo is 2, the output is: Result: 8 integer numResult integer numOne integer numTwo numOne = Get next input numTwo = Get next input // Your solution goes here Put "Result: " to output Put numResult to output
Akash M.
Write code that assigns resultValue with firstValue / secondValue. Ex: If firstValue is 4 and secondValue is 2, the output is: Result: 2 integer resultValue integer firstValue integer secondValue firstValue = Get next input secondValue = Get next input // Your solution goes here Put "Result: " to output Put resultValue to output
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD