003-004-011

Multiplication and Division Compound Assignment

Medium

Problem Description

Multiplication and Division Compound Assignment

In this problem, you will create a program that calculates the final product price by applying multiplication (*=) and division (/=) compound assignment operators sequentially to the price variable and displays the result to standard output.

Learning Objective: Understand multiplication (*=) and division (/=) compound assignment operators

Overview

Use multiplication and division compound assignment operators in product price calculation.

Specifications

  • Initialize variable price with 200
  • Multiply by quantity 5 using *= operator (total amount)
  • Divide by 2 using /= operator (half-price sale)
  • Output the final price

Output Format

Final Price: 500

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up