You are required to write a program in c++ that creates a mini
- brand – string
- fabric-- string
- color - string
- price - float
- totalStock – int
- avaiableQuantity--int
- quantityToBuy – int // amount of pieces to buy.
You need to provide following functions in the struct
- Provide a function print() so that when called, this function prints the details about the Dress in formatted manner.
- IsAvailable(string brand) which checks the stock for the brand of dress in the botique if available then returns true otherwise false.
- You need to provide the function Buy(string brand, string fabric ).
This function represents the action of buying dress based on brand user selects available brands are (Nishat, Sana Safinaz, Saphhire, Khadi) and available fabrics are (Lawn, Cotton, Linen) also note down please check that the stock is available or not for required quantity ,for each type of brand price is different for different fabrics
- Nishat 3pc suit price is 4500 with fabric Lawn, For Cotton price will be 4000, and fro linen it is 3500.
- Sana Safinaz price would be 3500 For Lawn, for cotton is 2800, and for linen it is 3000,
- Saphhire 2500 for lawn, and 2200 for cotton and 3000 for Linen.
- Khadi it is 5500 for Lawn, 5000 for cotton and 6000 for linen.
If enough quantity is available only then dress can be bought otherwise error message will be shown.
Now create an array of 10 Dresses (different brand and fabric) Input the values from user.
Now do the following
- Print your Dresses collection,
- Ask the user which color, fabric and brand she wants for her (Nishat, Sana Safinaz, Saphhire, and Khadi). Check that enough quantity is available or not ( also update stock as well) for the chosen brand then print only that Dress details and the bill receipt to the user after adding 20% sales tax for Khadi, 15% for Saphhire, 10% for Sana Safinaz, 8% for Nishat.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images