Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ACTIVITY 2 . 9 . 1 : Using constants in expressions. Full screen 5 6 8 8 1 4 . 4 2 6 7 4

ACTIVITY
2.9.1: Using constants in expressions.
Full screen
568814.4267496.q3zqy7
The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound. Organize the correct code statements to:
Declare a constant integer variable named CENTS_PER_POUND and initialize the constant with the value 25.
Read the shipping weight from input and store the weight into shipWeightPounds.
Using the constants FLAT_FEE_CENTS and CENTS_PER_POUND, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds.
Ex: If the input is 10, then the output is:
Weight(lb): 10, Flat fee(cents): 75, Cents per lb: 25
Shipping cost(cents): 325
Note: This activity includes distractors. Not all code statements on the left will be used in the final solution.
How to use this tool
Unusedmain.cppLoad default template...
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions