Organize code statements to declare constant CENTSPERPOUND = 25, read shipWeightPou...

Check the final answer first, then review the worked steps.

Answer

\(final int CENTS_PER_POUND = 25; shipWeightPounds = scnr.nextInt(); shipCostCents = FLAT_FEE_CENTS + (CENTS_PER_POUND * shipWeightPounds);\)

Approach

final int CENTS_PER_POUND = 25;
shipWeightPounds = scnr.nextInt();
shipCostCents = FLAT_FEE_CENTS + (CENTS_PER_POUND * shipWeightPounds);

Step-by-step solution

  1. Declare the constant using the final keyword: final int CENTS_PER_POUND = 25;.
  2. Read the input into the variable: shipWeightPounds = scnr.nextInt();.
  3. Calculate the total cost using the provided constants: shipCostCents = FLAT_FEE_CENTS + (CENTS_PER_POUND * shipWeightPounds);.