cout << " Enter 1 for letter, 2 for envelope, 3 for parcel: ";
cin >> EnvelopesNumber;
cout << " Enter weight in ounces: ";
cin >> ounces;
switch (EnvelopesNumber) //is a switch statement that add ounces for the packge if its greater than one ounce or 3 ounces for parcels
{
case 1 :
if (ounces <= 1)
Envelopesrice = 0.49;
else
Envelopesrice = 0.49 + ((ounces - 1)* 0.22);
break;
case 2 :
if (ounces <= 1)
Envelopesrice = 0.98;
else
Envelopesrice = 0.98 + (ounces * 0.22);
break;
case 3 :
if (ounces <= 3)
Envelopesrice = 2.54;
else
Envelopesrice = (2.54 + (ounces - 3)) * 0.20
break;
} // end of switch statement
cout << "the price is " << Envelopesrice << endl;
You need to be more specific and should give details about the problem. Also, you should share all the block. How do we understand what you do expect from this piece of code?