2023 mplement the class structure that represents a shopping cart for an online shop and items | Assignment Collections
Computer Science 2023 Computer Science C++
2023 mplement the class structure that represents a shopping cart for an online shop and items | Assignment Collections
mplement the class structure
that represents a shopping cart
for an online shop
and items that
can be put in
the shopping cart
.
Create the following classes
. Use appropriate access modifiers
(
member
variables should be private!)
and data types for each.
Don’t forget to add
getter
and
setter functions
for each member variable.
•
Item
: This class has the
member variable
s
called
title
,
description
, and
price
.
It has a
pure
virtual
function
called print
(
void print() = 0;
)
that prints the type and description of
the current object to the console. This function is NOT
implemented in this class but
must be implemented/overridden in the three subclasses below.
o
Book
:
This class inherit
s
from Item. It has an
instance variable called pageCount.
o
Movie
:
This class inherits from Item. It has an instance variable called length.
o
CD
:
This class inherits from Item. It has an instance variable called trackCount.
•
ShoppingCart
:
This class
keeps track of items that were bought
.
It
has
a single
constructor which expects the maximum number of items that can be placed in the cart.
It must
have a dynamically allocated array of pointer
s
to an item object
(
Item
*
* array
;
)
which is initialized in the
constructor
(
array =
new Item*[size]
).
The cart
must have
functions to add an item
object to the
cart
and
the items c
urre
ntly in the cart to
the console by calling each o
bject’s
()
function.
can anyone do this assignment for me plagiarism free in c++
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.