//Cecilia Rangel CSC5 Chapter 6, P.374, #16
//
/**************************************************************
*
* TRANSIENT POLUTION
* ____________________________________________________________
* This program will ask for the user to input a positive
* number, and decimal point, and calculates the retail
*
*_____________________________________________________________
* INPUT
* user input : wholesesale cost and markup percentage
* OUTPUT
* price : retail price
*
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
//Function prototype
float calculateRetail(float, float);
int main() {
//Variables to be used
float wholeSale;
float markup;
float retailPrice;
//Retrieving user input
cout << "What is the wholesale cost?" << endl;
cin >> wholeSale;
cout << "What is the markup percentage?" << endl;
cin >> markup;
//If statement not allowing negative numbers
if (wholeSale < 0 || markup < 0){
cout << "No negative numbers will be accepted.";
}
retailPrice = calculateRetail(wholeSale, markup);
//Formatting and displaying output
cout << fixed << setprecision(2);
cout << "The retail price is " << retailPrice;
return 0;
}
//*********************************************************
// Definition of function calculateRetail. *
// This function displays the retail price of an item. *
// ********************************************************
float calculateRetail(float wholeS, float markup)
{
return ((wholeS * markup) + wholeS);
}