Answered step by step
Verified Expert Solution
Question
1 Approved Answer
d- We want to count the quantity (number) of the purchased products -Add an attribute quantity type integer to class product ; - Increment the
d- We want to count the quantity (number) of the purchased products -Add an attribute quantity type integer to class product ; - Increment the quantity inside the constructor. -Add getter method to quantity getTotalQuantity -Display total quantity of the products, what do you think about the result? Create a project with name OOPProject b- Create class with name Product in the package named OOPPackage with the following attributes and methods. c- create main class to Create 3 Product instances: (//add constructor with 3 parameters) p1 (id =6745, price =5.50, name = "Penne Pasta") p2 (id =8853, price =6.50, name = " Spaghetti Pasta ") p3 (id =2106, price =4.50, name = " Linguine Pasta ") Use addToShoppingCart() to display the name value of p1,p2,p2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started