(Solved) : Hi Already Posted Code Question 8 Days Havent Got Answer Please Send C Code Problem Thank Q44168038 . . .
hi
i had already posted this code in other question for 8 days buti havent got any answer until now .please send me the c++ code forthis problem
thank you
task 1
Define an abstract base class for an offered article with nameArticle. This class shall have following members:
a private string attribute with name model storing the articlemodel name.
two private real valued attributes with names netprice for the netprice and taxRate storing the tax value in percent of thearticle.
a public constructor with three parameters to initialise theattributes of an object; the tax rate shall be a default parameterwith 19 %.
a virtual public destructor producing an output “~Article()” at itscall and the article model name (see examples below).
a public method with name set_model assigning a string parameter tothe model name attribute
a public method with name set_netPrice assigning the doubleparameter to the net price attribute.
a public method with name get_model without parameters returningthe model name as function value.
a public method with name get_netPrice without parameters returningthe net price as function value.
a public method with name get_grossPrice without parametersreturning the gross price (gross price = net price + tax) asfunction value.
a pure virtual public method with name print without parameter orreturn value.
task 2
Define a class with name Accessory derived from abstract classArticle. This class shall have following members:
a private Boolean attribute with name original for an originalaccessory.
a public constructor with three parameters for the article name,the net price and whether it is an original accessory with true asdefault parameter. The tax rate shall be automatically initialisedby the default parameter of class constructor Articlea virtualpublic destructor producing an output “~Accessory()” at its call(see examples at the bottom).
a virtual public destructor producing an output “~Accessory()” atits call (see examples at the bottom).
a virtual public method with name print without parameters writingthe article name and “(original accessory)”, if it is an originalone (see examples at the bottom).
task 3
Define a C++11 enumeration class with name OperatingSystem andenumeration values unknown, android, iOS, macOS, linux,proprietary, unix and windows.
Define an overloaded output operator << for a textual outputof an operating system name (“unknown OS”, “Android OS”, “iOS”,”MacOS”, “Linux OS”, “proprietary OS”, “Unix OS”, “MS Windows OS”)onto an output stream (see example at the bottom)
task 4
Define a class with name Device derived from abstract classArticle. This class shall have following members:
a private integer attribute with name main_memory storing the sizeof the main memory.
a private attribute with name os for the operating system of thedevice.
a public constructor with four parameters for the article name,the net price, the main memory size and the operating system withdefault parameter unknown; the tax rate shall be automaticallyinitialised by the default parameter of class constructorArticle.
a virtual public destructor producing an output “~Device()” atits call (see examples at the bottom).
a public method with name get_os without parameter returning theoperating system.
a virtual public method with name print without parameter orreturn value outputting the article name, followed by “RAM”, themain memory size, “GB” as well as the operating system (seeexamples at the bottom).
task 5
Define a class with name Notebook derived from class Device.This class shall have following members:
a private string attribute with name drive.
a private Boolean attribute with name convertible for aconvertible one.
a public constructor with six parameters for the article name,the net price, the main memory size, the drive, the operatingsystem with default parameter OperatingSystem::linux as well aswhether it is a convertible with default parameter false; the taxrate shall be initialised automatically by the constructor of theupper class.
a virtual public destructor producing an output “~Notebook()” atits call (see examples at the bottom).
a public method with name is_a_convertible without parametersreturning a Boolean function value whether the notebook is aconvertible.
a virtual public method with name print without parameters,calling method print of the direct upper class, in case of aconvertible outputs string “(convertible)” and afterwards thedrive.
task 6
Define a class with name Phone derived from class Device. Thisclass shall have following members:
a public constructor with four parameters for the article name, thenet price, the main memory size with 4GB as Defaultparameter andthe operating system Android OS as default parameter; the tax rateshall be initialised automatically by the constructor of the upperclass.
a virtual public destructor producing an output “~Phone()” atits call (see examples at the bottom).
a virtual public method with name print without parameterscalling method print of the direct upper class and afterwardsoutputting “phone”.
task 7
Define a class for an article in the shopping cart with nameInCart. This class shall have following members:
a private pointer attribute with name article to an object of classArticle.
a private integer attribute with name amount how many of thisarticle are placed in the shopping cart.
a private attribute with name next of type pointer to InCart forbuilding up a list.
a public constructor with three parameters to initialise thethree attributes of an object; the amount shall be 0 as defaultparameter, the pointer to the next article in a shopping cart anull pointer also as default parameter.
a virtual public destructor outputting “~Incart()” and theamount as well as calling the destructor for the article (seeexamples at the bottom).
a public method with name get_next without parameters returninga pointer to the next article in shopping cart as functionvalue.
a virtual public method with name print without parameters,outputting the amount, then sending message print to the article inthe shopping cart, then in a new line outputting formatted as inthe examples at the bottom the single gross price and the totalgross price for the chosen amount of articles onto an output stream(see example at the bottom).
task 8
Define a class for a shopping cart with name ShoppingCart. Thisclass shall have following members:
a private pointer attribute with name articles to the head of alist of articles in the shopping cart of class InCart.
three private real valued attributes with names minFressShippingfor which purchase value free shipping is offered, sumNetPrice forthe total net price sum of all articles in the shopping cart andsumGrossPrice for the total gross price sum.
a public standard constructor initialising an empty shoppingcart with both sum values 0 EUR and the purchase value for freeshipping with1000 EUR.
a public destructor outputting “~ShoppingCart()” and afterwardsdeleting each article in the shopping cart starting with an output”delete article: ” such that no memory leak will exist.
a public method with name set_minFreeShipping with one parameterassigning its value to the same named attribute.
a public method with name add_article with an amount and apointer to an article as parameters, adding a new object InCart onheap to the shopping cart and actualising the two sum variables ofthe class appropriately.
a virtual public method with name print without parameterswriting a shopping onto the standard output stream cart formattedas given in the examples at the bottom. Especially the net pricesum, the tax (difference gross minus net total sum) and the grossprice sum shall be outputted at the end of the shopping cart. Takecare to also regard the (may be) shipping cost output of 5.90 EUR(see example at the bottom)!
task 9
To test write a main function placing some articles as newobjects on the heap into an electronic shopping cart:
define a shopping cart object of type ShoppingCart using thestandard constructor.
Send a message to this object that the articles get freeshipping starting from 500 EUR.
Add to this shopping cart a new accessory article on heap withan amount of three powerbanks “YOOLOX 10k Wireless Powerbank Qi”with single net price 31.08 EUR being no original accessory.
Print the complete shopping cart (there are shipping costs).
Add to this shopping cart a new smart phone “Samsung Galaxy S10+SM-G975F/DS Dual SIM” with net price 661.67 EUR, 8GB main memorysize and Android OS operating system.
Add to this shopping cart two new smart phones “Apple iPhone 11Pro 256GB” with net price 1097.47 EUR, 4GB main memory size and iOSoperating system.
Add to this shopping cart a new notebook “ASUS ROG Strix ScarIII G731” with net price 1586.55 EUR, 16GB main memory size, “512GBSSD + 1TB SSHD” as drive and MS Windows operating system.
Print again the complete shopping cart (now there are noshipping costs).
With the end offunction main automatically the complete shoppingcart object gets deleted; your program shall show the outputs ofthe destructor calls like in the example given below.
Expert Answer
Answer to hi i had already posted this code in other question for 8 days but i havent got any answer until now .please send me the…
OR