Question
In C++. The One Stop Fabric Shop sells 80 yards bolt of fabric for $100 each. Your job is to write a program that provides
In C++.
The One Stop Fabric Shop sells 80 yards bolt of fabric for $100 each. Your job is to write a program that provides an invoice to a customer that will also include information on anything that might be back ordered.
The program should have a function that asks for the following data:
Customer information (include name, mailing address and phone number)
The number of bolts ordered.
The number of bolts in stock.
Whether there are special shipping and handling charges. (Shipping and handling is normally $10 per bolt.)
Some customers may have special shipping and handling charges associated to having their own accounts to charge. If the customer has their own account their shipping and handling charges should be entered by the customer. This is a charge that is not collected by One Stop Fabric Shop but should still display as part of the invoice.
You should set up your output to a file (name it invoice.txt). The output file should look familiar to an invoice, you may get ideas of what invoices look like by searching online. Information that must be found on the invoice includes:
The address for One Stop Fabric Shop (300 N. Beaty St. Athens, AL 35611. phone: 256-233-6500)
The customer information
The number of bolts the customer is ordering and the amount for each followed by the amount that it will cost for the order.
If the customer is ordering more bolts than what is available in stock, then the number of bolts being ordered should not include the backorder. There should be an addition line similar to that above that shows the backorder (this will be shipped and charged when the order is filled).
Note: Customer should not have a shipping charge for back ordered items
The cost of tax (tax is 8.73%)
The total for the order
The total for the order with shipping and handling.
There should also be an invoice number that is randomly generated by your program (use the rand function here).
You should have three functions for this program:
Gather the customer information.
Get the stock information (this function should be a pass by reference, you are obtaining the number of bolts the customer wants, the number that is in stock, and if there are any special shipping charges).
A function that displays all of the information in the invoice.
A sample output is found attached
INVOICE one stop Fabric shop 300 N. Beaty st. Athens, AL 35611 256-233-6500 Customer Name 2487 Customer Street City, State 58649 817-552-3647 INVOICE # 856140 Item Unit Price Quantity Amount Fabric Bolt Fabric Bolt - Backordered 100.00 100.00 500.00 (300.00) Subtotal Tax Product Total Shipping Charges Tota 500.00 43.65 543.65 10.00 553.65 Backorder Subtotal Tax Product Total shping Charges 300.00 26.19 326.19 0 326.19 Tota Full order Total 879. 84 INVOICE one stop Fabric shop 300 N. Beaty st. Athens, AL 35611 256-233-6500 Customer Name 2487 Customer Street City, State 58649 817-552-3647 INVOICE # 856140 Item Unit Price Quantity Amount Fabric Bolt Fabric Bolt - Backordered 100.00 100.00 500.00 (300.00) Subtotal Tax Product Total Shipping Charges Tota 500.00 43.65 543.65 10.00 553.65 Backorder Subtotal Tax Product Total shping Charges 300.00 26.19 326.19 0 326.19 Tota Full order Total 879. 84Step 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