As I said in the header this code will compile, yet it puts out erroneous results, and says the "wholesale" & "MarkUp" variables are not initialized. The output of the program remains the same no matter what input is entered. If you could help me to see what I am doing wrong I would greatly appreciate it.
// chap6proj.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <iomanip>
usingnamespace std;
double calculateRetail (double, double);
int main ()
{
double wholesale, MarkUp, Retail;
Retail = calculateRetail (wholesale, MarkUp);
cout << "This program will calculate the retail cost of any item.\n\n";
cout << "Enter the wholesale price of the item: ";
cin >> wholesale;
cout << "\n\nNow enter the mark up percentage as a whole number: ";
cin >> MarkUp;
if (wholesale >= 0 && MarkUp >= 0)
{
cout << setprecision (2) << fixed << showpoint;
cout << "The retail price of the item is: " << Retail << endl << endl;
}
else
cout << "The values entered may not be negative numbers.\n\n";
system ("PAUSE");
return 0;
}
double calculateRetail (double Thing1, double Thing2)
{
return Thing1 * (Thing2 * .01) + Thing1;
}