Answer to Question #8815 in C++ for alex lee
Question #8815
Write a function calculateItemCost prototyped by
double calculateItemCost(double itemPrice, char discountType, unsigned quantity)
double calculateItemCost(double itemPrice, char discountType, unsigned quantity)
Expert's answer
double calculateItemCost(double itemPrice, char discountType, unsigned quantity)
{
return itemPrice * (1 - (double)discountType / 100.) * quantity;
}
{
return itemPrice * (1 - (double)discountType / 100.) * quantity;
}
Need a fast expert's response?
Submit orderand get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment