The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound. 1. Declare a const named CENTS_PER_POUND and initialize with 25. 2. Get the shipping weight from user input storing the weight into shipWeightPounds. 3. Using FLAT_FEE_CENTS and CENTS_PER_POUND constants, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds.

#include
using namespace std;

int main() {
int shipWeightPounds;
int shipCostCents = 0;
const int FLAT_FEE_CENTS = 75;

/* Your solution goes here */

cout << "Weight(lb): " << shipWeightPounds;
cout << ", Flat fee(cents): " << FLAT_FEE_CENTS;
cout << ", Cents per lb: " << CENTS_PER_POUND;
cout << ", Shipping cost(cents): " << shipCostCents << endl;

return 0;
}

Respuesta :

Answer:

Replace /* Your solution goes here */

with

const int CENTS_PER_POUND = 25;

cout << "Weight(lb): ";

cin >> shipWeightPounds;

shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;

Explanation:

This line declares and initializes CENTS_PER_POUND as constant integer to 25

const int CENTS_PER_POUND = 25;

This line prompts user for weight of shipment

cout << "Weight(lb): ";

This line gets weight from the user

cin >> shipWeightPounds;

This line calculates the cost of shipment

shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;

In this exercise we want to use computer and python knowledge to write the code correctly, so it is necessary to add the following to the informed code:

So we can see that in the attached image we find the code that corresponds to the answer to this question.

Are analyzing the code informed in the question we can say that:

This line declares and initializes CENTS_PER_POUND as continual number to 25, the code that we have is:

const int CENTS_PER_POUND = 25;

cout << "Weight(lb): ";

cin >> shipWeightPounds;

shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;

See more about computer at brainly.com/question/950632

Ver imagen lhmarianateixeira
ACCESS MORE
EDU ACCESS
Universidad de Mexico