I keep getting the following errors and can't seem to resolve them:
error LNK2019: unresolved external symbol "double __cdecl orderIn(double,double,double)" (?orderIn@@YANNNN@Z) referenced in function _main
fatal error LNK1120: 1 unresolved externals
I know there is something wrong with the way I am trying to pass the variable through the functions but I just can't get it. I want the information gathered and calculated in the first function to pass through and be utilized by the second function. I have tried numerous methods to no avail.
What am I missing here?
Thanks!
#include <iostream>
#include <iomanip>
using namespace std;
double orderIn(double, double, double);
void shippingOut(double, double, double);
double spoolsOrdered,
spoolsInStock,
shipping,
total,
backordered,
charges,
spoolsShipping;
int main()
{
orderIn(spoolsOrdered, spoolsInStock, shipping);
shippingOut(spoolsShipping, backordered, total);
return 0;
}//end int main
double orderIn(double &spoolsOrdered, double &spoolsInStock, double &shipping)
{
char extracharge;
//spools ordered
cout << "How many spools would you like to order? ";
cin >> spoolsOrdered;
while (spoolsOrdered < 1)
{
cout << "That is not a valid entry ";
cin >> spoolsOrdered;
}
//spools in stock
cout << "How many spools are currently in stock? ";
cin >> spoolsInStock;
//extra charges
cout << "Are there any special charges on this order? ";
cin >> extracharge;
//special charges
if ( extracharge == 'Y' || extracharge == 'y')
{
cout << "What is the additional charge per spool? ";
cin >> charges;
shipping = (10 + charges);
}
else
shipping = 10;
return (&spoolsOrdered, &spoolsInStock, shipping);
}
void shippingOut(double spoolsOrdered, double spoolnStock, double shipping)
{
double backordered;
double subTotal;
double totalShipping;
double total;
double spoolsShipping;
if (spoolsOrdered > spoolsInStock)
{
backordered=(spoolsOrdered - spoolsInStock);
cout << "There are " << spoolsInStock << " spools ready to be shipped./n";
cout << "The remaining " << backordered <<" are on backorder.";
spoolsShipping=spoolsInStock;
}
else
{
cout << "All " <<spoolsOrdered << " spools ordered are ready to ship.\n";
spoolsShipping=spoolsOrdered;
}
//Product Charges
subTotal = spoolsShipping * 100;
cout << "Subtotal: $" << subTotal << endl;
//Shipping Charges
totalShipping = spoolsOrdered * shipping;
cout << "S/H Total: $" << totalShipping << endl;
//Total
total = subTotal + totalShipping;
cout << "The total of the order ready to ship is: $" << total << endl;
}