mercredi 29 avril 2020

Does anybody know what i am doing wrong? getting retail price c++

Description: Write a complete C++ program that asks the user to enter an item’s wholesale cost and its markup percentage (not per dollar). It should display the item’s retail price. That’s the over all description of this problem.

*/

include

using namespace std;

// function1. ask user for wholesale value.

double getWholesaleCost(){
    double WholesaleCost;
    cout << " Enter the products Wholesale cost: ";
    cin >> WholesaleCost;
    return WholesaleCost;

}

// function2, ask for markup percentage for the wholesalecost.

double getMarkup(){
    double markup_percentage;
    cout << " Enetr markup percentage of the item’s wholesale price: ";
    cin >> markup_percentage;
    return markup_percentage;

}

double calculateRetail(double wholesalePrice, double markup_percentage){
    double retailPrice = wholesalePrice * (markup_percentage / 100);
    retailPrice = wholesalePrice + retailPrice;
    return retailPrice;

}

// display function

void dispaly( double retailPrice){
    cout << " The retail price is: " << retailPrice;
    return;
}

//main function

int main(){


double wholesalePrice = getWholesaleCost();
    double markupPercent = getMarkup();
    double retailPrice = calculateRetail(wholesale, markupPercent);
    display(retailPrice);

return 0;

}

Aucun commentaire:

Enregistrer un commentaire