Question: Write a program C + + Judy runs a shop that sells molds used in arts and crafts, specifically for use with resin. The molds

Write a program C++
Judy runs a shop that sells molds used in arts and crafts, specifically for use with resin. The molds are made of silicone and come in various shapes and sizes. Each mold weighs a different amount which affects the shipping cost. Judy needs a program to help her process orders for her molds. You will create a program that allows Judy to enter an order for a mold and create an invoice in the form of an output file.
Start by creating an enum that represents the different possible sizes of molds. Then you will create a struct that represents the molds. To keep track of the order, you will also need to create a customer struct and an order struct. The specifications for the enum and structs are listed below.
Size Enumeration
Name
sizeType
Enumerators (Printed Name)
S ("Small")
M ("Medium")
L ("Large")
Mold Struct
Name
moldType
Members
shape : string
size : sizeType
price : double
weight : double
Customer Struct
Name
customerType
Members
fname : string
lname : string
address : string
Order Struct
Name
orderType
Members
customer : customerType
products : moldType []
numProdOrdered : int
subTotal : double
totalWeight : double
shippingCost : double
The catalog of products currently available will be kept in catalog.txt. Judy keeps 20 products in stock at a time. These are the products that will be ordered by customers. You will need to create the following functions to set up Judy's program.
Function 1
Name
readCatalog
Parameters
productCatalog : moldType[]
numProducts : int
Return Type
void
Description
This function reads catalog.txt. Each line of the file contains information about a mold that is currently for sale. Because she is frequently rotating stock around, this file will change and have different information in it (you cannot hardcode the data into the program).
Function 2
Name
enterOrder
Parameters
order : orderType& (by reference)
catalog: moldType[]
numItemsInCatalog : int
Return Type
void
Description
This function prompts the user for the information pertaining to an order. It will provide options that allow for up to 10 products to be selected. It will store the order information in the reference parameter. The shipping cost is calculated based on weight using the formula ship=0.58(weight)28.35
s
h
i
p
=
0.58
(
w
e
i
g
h
t
)
28.35
.
Function 3
Name
printProduct
Parameters
ostream& (output stream by reference, either a file or the console)
mold : moldType
Return Type
void
Description
This function takes the information about a mold and prints it using the output stream provided. This allows us to print to either a file or the console with the same function.
Function 4
Name
printOrder
Parameters
ostream& (output stream by reference, either the console or a file)
orderType& (the order we are going to print)
Return Type
void
Description
This function takes the information about an order and prints it to the stream that is given as a parameter. This allows the function to output to multiple sources, like an output file or the console.
For the main, you will first need to read the current product catalog into an array of moldType. Next, you will get the order information from Judy. You will output the order to the console and to a file named using the customer's last name. Lastly, you will ask if Judy wants to enter any more orders. If she answers "n," exit the program; if she answers "y," repeat the process of getting order information and creating a new output file.
Sample Output:
Welcome to Judy's Resin Molds!
Enter the customer first name: Peter
Enter the customer last name: Parker
Enter the customer street address: 112 Main St.
Enter the customer city, state, and zip code: Queens, NY 11415
Please choose a product from list:
1. Pendant - Medium $17.1048.00g
2. Dragon - Large $108.76200.00g
3. Heart - Small $26.6822.00g
4. Ornament - Medium $33.52101.00g
5. Seahorse - Large $33.52111.00g
6. Domino - Large $54.04145.00g
7. Tree - Large $67.72132.00g
8. Flower - Small $26.6856.00g
9. Coaster - Medium $13.0043.00g
10. Keychain - Small $25.4548.00g
11. Sun - Large $74.56125.00g
12. Geode - Medium $40.3687.00g
13. Angel - Medium $35.4174.00g
14. Butterfly - Small $14.6536.00g
15. Rose - Small $18.6544.00g
16. Spider - Medium $32.5489.00g
17. Bubble - Small $24.5742.00g
18. Tray - Large $60.88143.00g
19. Lizard - Medium $34.26112.00g
20. Turtle - Medium $42.12125.00g
1
Item: Pendant - Medium $17.1048.00g added.
Do you want to add another product to the order? y
Please choose a product from list:
1. Pendant - Medium $17.1048.00g
2. Dragon - Large $108.76200.00g
3. Heart - Small $26.6822.00g
4. Ornament - Medium $33.52101.00g
5. Seahorse - Large $33.52111.00g
6. Domino - Large $54.04145.00g
7. Tree - Large $67.72132.00g
8. Flower - Small $26.6856.00g
9. Coaster - Medium $13.0043.00g
10. Keychain - Small $25.4548.00g
11. Sun - Large $74.56125.00g
12. Geode - Medium $40.3687.00g
13. Angel - Medium $35.4174.00g
14. Butterfly - Small $14.6536.00g
15. Rose - Small $

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!