1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#include <iostream> // input/output declarations
#include <iomanip> // i/o manupulator declarations
using namespace std;
void searchWArray (int []);
int main ()
{
double pweight, length1, length2, length3, pgirth;
int weight[15] = {1,2,3,5,7,10,13,16,20,25,30,35,40,45,50};
double shipcharge [15] = {1.50, 2.10, 4.00, 6.75, 9.90, 14.95, 19.40, 24.20,27.30, 31.90, 38.50, 43.50, 44.80, 47.40, 55.20};
cout << "For each transaction, enter package weight and 3 dimensions. Enter -1 to quit.\n";
do
{
cout << "Enter package weight and 3 sides : \n";
cin >> pweight >> length1 >> length2 >> length3;
if (pweight < 0);
cout << "Error - package weight and dimensions must be larger than 0 \n Please re-enter transaction";
if (length1 < 0);
cout << "Error - package weight and dimensions must be larger than 0 \n Please re-enter transaction";
if (length2 < 0);
cout << "Error - package weight and dimensions must be larger than 0 \n Please re-enter transaction";
if (length3 < 0);
cout << "Error - package weight and dimensions must be larger than 0 \n Please re-enter transaction";
} while (pweight != -1);
system ("PAUSE");
return 0;
}
void searchWArray (int [])
{
int count = 0;
int searchFor = 0;
int weight[15] = {1,2,3,5,7,10,13,16,20,25,30,35,40,45,50};
for (int x = 0; x > 1; x = x + 1)
if (weight[x] > searchFor)
count = count + 1;
}
| |