1. Engineering
  2. Computer Science
  3. part 1 groceryitem 20 points for part 1 you must...

Question: part 1 groceryitem 20 points for part 1 you must...

Question details

Part 1: GroceryItem (20 points) For part 1 you must implement the constructor, getName, getCount, getCost, getCategory, mutliplyltemCount, setCount, setName, setCost, setCategory, str and repr methods. You may not change the method definitions. See the doc strings in the file for information and see the usage below for details. >>>gr-GroceryItem () >>>str (gr) :0:0: >>> repr (gr) GroceryItem(,0,O,D >>> gr2-GroceryItem (milk , 1.99,2, dairy) >>>gr2 GroceryItem (milk ,1.99,2, dairy > str (gr2) milk:1.99:2:dairy >>>gr2.getcost () 1.99 >>gr2.setcost (2.99) >>>gr2 GroceryItem (milk,2.99,2, dairy) >>> str (gr2) milk:2.99:2:dairy >>>gr2.multiplyItemCount (3) >>> str (gr2) milk:2.99:6:dairy >>> repr (gr2) GroceryItem (milk, 2.99, 6, dairy)
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution