Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Coding ***Here is my coding, but the outputs below are incorrect. Please help fix this**** #include #include // std::setprecision using namespace std; // Function

C++ Coding

image text in transcribedimage text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed***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

image text in transcribedimage text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions