Week05Assignment.cpp
// The DisplayPurchase function which will display the total number of each surfboard purchased
// Added iTotalXXXS as a parameter
The DisplayPurchase function which will display the total number of each surfboard purchased
Added iTotalXXXS as a parameter
The DisplayPurchase function which will display the total number of each surfboard purchased Added iTotalXXXS as a parameter
void DisplayPurchase(const int iTotalSmall, const int iTotalMedium, const int iTotalLarge, const int iTotalXXXS) {
    if (iTotalSmall != 0) {
        cout << "The total number of small surfboards is " << iTotalSmall << endl;
    }
    if (iTotalMedium != 0) {
        cout << "The total number of medium surfboards is " << iTotalMedium << endl;
    }
    if (iTotalLarge != 0) {
        cout << "The total number of large surfboards is " << iTotalLarge << endl;
    }
    if (iTotalXXXS != 0) {
        cout << "The total number of XXXS surfboards is " << iTotalXXXS << endl;
    }
    if (iTotalSmall == 0 && iTotalMedium == 0 && iTotalLarge == 0 && iTotalXXXS == 0) {
        cout << "No purchases made yet." << endl;
    }
}
void DisplayPurchase ( const int iTotalSmall , const int iTotalMedium , const int iTotalLarge , const int iTotalXXXS ) { if ( iTotalSmall != 0 ) { cout << " " << iTotalSmall << endl ; } if ( iTotalMedium != 0 ) { cout << " " << iTotalMedium << endl ; } if ( iTotalLarge != 0 ) { cout << " " << iTotalLarge << endl ; } if ( iTotalXXXS != 0 ) { cout << " " << iTotalXXXS << endl ; } if ( iTotalSmall == 0 && iTotalMedium == 0 && iTotalLarge == 0 && iTotalXXXS == 0 ) { cout << " " << endl ; } }
The DisplayPurchase function which will display the total number of each surfboard purchased
Added iTotalXXXS as a parameter
The DisplayPurchase function which will display the total number of each surfboard purchased Added iTotalXXXS as a parameter
// We don't want to display the sizes that haven't received any purchases yet // I used if statements to do this // if statement for the xxxs size // had to add xxxs to this as well