Question: Create a class product with attributes: no, name, cost, quantity and functions: price to calculate and return the price of the product as following price

Create a class product with attributes: no, name, cost, quantity and functions: price to calculate and return the price of the product as following price = cost * 1.7 if the cost less than 20$ and price = cost * 1.5 otherwise reduceQuantity( soldQty) to reduce the available quantity by the soldQty in the main: create an array of products. let the user enter some products. then let the user enter a name of product to buy search if the product exists then show its price and ask the user about the required quantity and check if the required quantity available calculate the total price and add 13% for tax show the total price and reduce the quantity by the sold quantity. and ask the user if want to buy another product if not exit. using swift programming language

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!