C++ Coding
***Here is my coding, but the outputs below are incorrect. Please help fix this****
#include #include // std::setprecision using namespace std; // Function Declarations void readInputData(int& spoolsOrdered, int& spoolsInStock, double& shippingCharges); void display(int spoolsOrdered, int spoolsInStock, double shippingCharges); int main() { // Declaring variables int spoolsOrdered, spoolsInStock; double shippingCharges; // Calling the functions readInputData(spoolsOrdered, spoolsInStock, shippingCharges); display(spoolsOrdered, spoolsInStock, shippingCharges); return 0; } // This function will read the inputs entered by the user void readInputData(int& spoolsOrdered, int& spoolsInStock, double& shippingCharges) { /* This while loop continues to execute * until the user enters a valid number */ while (true) { cout > spoolsOrdered; if (spoolsOrdered > spoolsInStock; if (spoolsInStock char ch; cout > ch; if (ch == 'y') { /* This while loop continues to execute * until the user enters a valid number */ while (true) { cout > shippingCharges; if (shippingCharges
This lab lesson you are writing a program for the hypothetical Acme Wholesale Copper Wire Company. The Acme company sells spools of copper wiring for $100 each. Write a program that displays the status of an order. This program will be reading in from cin and writing to cout. In this program you will need at least three functions, including main as one of the three. You must use function prototypes for all of the functions (except main). Read function You need to have a function that reads in the following data: The number of spools ordered The number of spools currently in stock Any special shipping and handling charges (see description below). Your program needs to prompt for these values. The prompts are below under Sample with special shipping and handling. Do not accept a number less than 1 for the number of spools ordered. Do not accept a number less than 0 for the number of spools in stock. Do not accept a shipping and handling charge of less than 0. For each of these cases you will have to have a loop that issues an error message, prompts for the input value again, and checks the data for validity. The normal shipping and handling is $11.88 per spool. You will have to ask if there is special shipping and handling. If there is you will need to read in the special shipping and handling charge. Here are a couple of sample runs. One with the default shipping and handling and one with special shipping and handling. Sample with default shipping: Assume the following input from cin: 10 100 Here are the prompts to read in the spools to be ordered, spools in stock and shipping and handling