In basic C++, write a function to answer this question. 1. Markup Write a progra
ID: 3713788 • Letter: I
Question
In basic C++, write a function to answer this question.
1. Markup Write a program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: If an item's wholesale cost is $5.00 and its markup percentage is 100 percent, then If an item's wholesale cost is $5.00 and its markup percentage is 50 percent, then The program should have afiunction named cateulatotetai1 hat receives the wholesale the item's retail price is $10.00. the item's retail price is $7.50. cost and the markup percentage as arguments and returns the retail price of the item.Explanation / Answer
#include <iostream>
using namespace std;
double calculateRetail(double cost,double p) {
return cost + (cost * p)/100;
}
int main() {
double cost,p;
cout<<"Enter the wholesale cost: "<<endl;
cin >> cost;
cout<<"Enter the markup percentage: "<<endl;
cin >> p;
cout<<"Retail Price: "<<calculateRetail(cost, p)<<endl;
}
Output:
Enter the wholesale cost: 100
Enter the markup percentage:50
Retail Price: 150
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.