Question
Lab lesson 9 has two parts. There are also 10 bonus points. To earn the bonus points you have to complete the Participation activities and
Lab lesson 9 has two parts.
There are also 10 bonus points. To earn the bonus points you have to complete the Participation activities and Challenge activities for zyBooks unit 4. These have to be completed by the due date for lab lesson 9.
Both parts will be making use of functions, and pass by reference.
Part 1 is worth 35 points (25 points for passing the tests and 10 for your code). Failure to meet the requirements could result in loss of points beyond the 10 for the code formatting, variable names, and so on.
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.
using C++ pls, make sure white space is correct
Sample with default shipping Assume the following input from cim: 10 100 Here are the prompts to read in the spools to be ordered, spools in stock and shipping and handling: spools to be ordered spools in stock Special shipping and handling (y or n) Sample with special shipping and handling Assume the following input from cin 10 100 9.99 Here is the output or the prompts to cout spools to be ordered spools in stock special shipping and handling (y or n) Shipping and handling amount Note that the Shipping and handling amount prompt is only written out if the input from cin was y from the Special shipping and handling or n) promptStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started