Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Middletown Wholesale Copper Wire Company sells spools of copper wiring for $

ID: 3622430 • Letter: T

Question

The Middletown Wholesale Copper Wire Company sells spools of copper wiring for $100 each. Write
a program that displays the status of an order.

The program should have a function that asks for the following information:
• The number of spools ordered.
• The number of spools in stock.
• If there are special shipping and handling charges.
Shipping and handling is normally $10 per spool. If there are special charges, it should ask for the
special charges per spool.

The information returned from the above function will be passed to another function that displays:
• The number of spools ready to ship from current stock.
• The number of spools on backorder (if the number ordered is greater than what is in stock).
• Subtotal of the portion ready to ship (the number of spools ready to ship times $100).
• Total shipping and handling charges on the portion ready to ship
• Total of the order ready to ship.
The shipping and handling parameter in the second function should have the default argument 10.00.

Input validation:
• Do not accept a number less than one for the spools ordered.
• Do not accept a number less than zero for spools in stock.
• Do not accept a number less than zero for shipping and handling.
• For each validation task use a do-while loop.

I have this so far:



#include< iostream >

#include< iomanip >

 

using namespace std;

// Function prototypes
void getStockInfo(int &, int &, double &);
void displayStatus(int, int, double = 10);

int main()
{
int inStock, onOrder;
double special;

getStockInfo(onOrder, inStock, special);
if (special == 0)
displayStatus(onOrder, inStock);
else
displayStatus(onOrder, inStock, 10.0 + special);

system("PAUSE");
return 0;
}//end main

cout<<"How many spools were ordered? ";
cin>>onOrder;
cout<

while(onOrder<1){
cout<<"The number of spools ordered must be one or more. Please re-enter ";
cin>>onOrder;
return getStockInfo(onOrder);}

cout<<"How many spools are in stock? ";
cin>>inStock;

cout<<" Enter the amount of any special shipping charges above the regular $10 per spool rate (0 for none): ";
cin>>special;
cout<

cout<<"Spools ordered: "<<


void getStockInfo(int &ord, int &stock, double &spec)
{
//
// Fill in code for function.
//

}//end getStockInfo


// Function displayStatus. Accepts as arguments the number of spools
// ordered, the number in stock, and the shipping charges per spool.
// The default value for shipping charges is 10.

void displayStatus(int ord, int stock, double ship)
{

//
// Fill in code for function.
//

}//end displayStatus


Explanation / Answer

Dear, Here is the code //Header file section #include using namespace std; //function prototype void getData(double &,double &,double &); void display(double,double,double); void main() { double noSpools,spoolsReady,charges; //function call getStockInfo (noSpools,spoolsReady,charges); //function call to diplay displayStatus(noSpools,spoolsReady,charges); //pause system for a while system("pause"); }//end main //function definition void getStockInfo (double &spools,double &ready, double &charges) { coutspools; //validate input if(spools