+1(978)310-4246 credencewriters@gmail.com
Select Page

project 6 will continue on the fallowing code

#include

#include

#include

using namespace std;

double get_volume(int length, int width, int height);

int* get_dimensions();

double getRate(double volume);

void print(double volume, double subtotal);

double get_volume(int length, int width, int height)

{

return (double)length * width * height;

}

int* get_dimensions()

{

cout << "Enter the package dimensions(feet):" << endl; double length, width, height; cout << "Length: "; cin >> length;

cout << "Width: "; cin >> width;

cout << "Height: "; cin >> height;

cout << endl; int *dimensions= new int[3]; dimensions[0] = length; dimensions[1] = width; dimensions[2] = height; return dimensions; } double getRate(int volume) { if (volume < 15) { return 1.5; } else if (volume < 30) { return 2.5; } else { return 3.0; } } void print(int volume, double subtotal) { double small = 1.5, medium = 2.5, large = 3.0; cout << "Package Volume: " << volume << " cubic feet" << endl; cout << setprecision(2) << fixed; double rate; if (volume < 15) { cout << setw(45) << left << "Shipping Cost (\$1.50 per cubic foot) " << setw(2) << left << "\$ " << setw(8) << right << subtotal << endl; } else if (volume < 30) { cout << setw(45) << left << "Shipping Cost (\$2.50 per cubic foot) " << setw(2) << left << "\$ " << setw(8) << right << subtotal << endl; } else { cout << setw(45) << left << "Shipping Cost (\$3.00 per cubic foot) " << setw(2) << left << "\$ " << setw(8) << right << subtotal << endl; } } int main() { cout << "East County Box Company" << endl << endl; cout << "Sales program (version 1.5)" << endl << endl; double subtotal = 0; char choice = 'N'; do { int volume = 0; double containerSubtotal = 0; double salestax = 0; do { int* dimensions = get_dimensions(); volume = get_volume(dimensions[0], dimensions[1], dimensions[2]); if (volume <= 65) { containerSubtotal = volume * getRate(volume); subtotal += containerSubtotal; print(volume, containerSubtotal); cout << endl; } else { cout << "This package exceeds 65 cubic feet limit. Please input again." << endl << endl; } } while (volume > 65);

cout << "Add another package (Y/N): "; cin >> choice;

cout << endl; } while (choice == 'Y'); double total = 0, salestax = 0; salestax = subtotal * 0.0775; total = salestax + subtotal; cout << setw(45) << left << "SubTotal " << setw(2) << left << "\$ " << setw(8) << right << subtotal << endl; cout << setw(45) << left << "Sales Tax (0.0775) " << setw(2) << left << "\$ " << setw(8) << right << salestax << endl << endl; cout << setw(45) << left << "Total " << setw(2) << left << "\$ " << setw(8) << right << total << endl; while(1) { int select; cout<<"nPayment (1. Cash, 2. Check, 3. Credit): "; cin>>select;

switch(select)

{

case 1:

double temp,change;

cout << setw(45) << left << "Accepted: " << setw(2) << left << "\$ " << setw(8) << right ; cin>>temp;

if(temp>=total)

{

change=temp-total;

cout << setw(45) << left << "Change: " << setw(2) << left << "\$ " << setw(8) << right << change << endl; } else cout<<"nInsufficient cash amountn"; break; case 2: { cout << setw(45) << left << "Enter Driver License No: " << setw(2) << left << setw(8) << right ; string s; cin>>s;

bool b=true;

for(int i=0;i90)

{

b=false;

break;

}

}

else

{

if(s[i]<48 || s[i]>57)

{

b=false;

break;

}

}

}

if(b)

cout << setw(45) << left << "Accepted Check Payment: " << setw(2) << left << "\$ " << setw(8) << right << total << endl; else cout<<"nLicense number not valid !n"; break; } case 3: char c; int n; cout << setw(45) << left << "Visa (V) or MasterCard (M): " << setw(2) << left << setw(8) << right ; cin>>c;

cout << setw(45) << left << "Enter Last Digit of Card: " << setw(2) << left << setw(8) << right ; cin>>n;

cout << setw(45) << left << "Accepted Credit Card Payment: " << setw(2) << left << "\$ " << setw(8) << right << total << endl; break; } } } #include #include #include using namespace std; double get_volume(int length, int width, int height); int* get_dimensions(); double getRate(double volume); void print(double volume, double subtotal); double get_volume(int length, int width, int height) { return (double)length * width * height; } int* get_dimensions() { cout width; cout > height;
cout