Write the one Sale method of the GroceryStore class. Method oneSale has one parameter: the name of one product (that a customer would like to buy). Method oneSale should attempt to carry out the sale of the named product, and it should return true or false depending on whether the sale is successful. The sale is successful if there is a product in the stock array with the given name and if the number of items in stock of that product is greater than zero. In that case, one Sale should subtract one from the number of items in stock and return true. If there is no product in the stock array with the given name or if the number of items in stock for that product is less than or equal to zero, oneSale should return false.
+2
Answers (1)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the one Sale method of the GroceryStore class. Method oneSale has one parameter: the name of one product (that a customer would like ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Home » Computers and Technology » Write the one Sale method of the GroceryStore class. Method oneSale has one parameter: the name of one product (that a customer would like to buy).