Menu

Dokument2 Word Suchen Entwurf Layout Referenzen Sendungen Berpr Fen Ansicht Hilfe Bildform Q43861608

Dokument2 - Word Suchen Entwurf Layout Referenzen Sendungen Überprüfen Ansicht Hilfe Bildformat 1. Define an abstract base clhassan moussa HM Teilen a virtual public destructor producing an output --Device ()- at its call (see examples at the bottom)Dekument - Word P Suchen rteurt Layout Referenzen Sendungen Oberprufen hamen me M Ansicht Hife Bildformat a public method witDokument2- Word P Suchen gen Überprüfen Ansicht Hife Bildformat 4536.40 EUR 861.92 EUR tax! sum grosa price: 5398.32 EUR shipDokument2 – Word Suchen Entwurf Layout Referenzen Sendungen Überprüfen Ansicht Hilfe Bildformat 1. Define an abstract base class for an offered article with name Artiole. This class shall have following members: a private string attribute with name model storing the article model name. two private real valued attributes with names netprice for the net price and taxRate storing the tax value in percent of the article. a public constructor with three parameters to initialise the attributes of an object, the tax rate shall be a default parameter with 19 %. a virtual public destructor producing an output “-Article ()” at its call and the article model name (see examples below). a public method with name set model assigning a string parameter to the model name attribute. a public method with name set netPrice assigning the double parameter to the net price attribute. a public method with name get model without parameters returning the model name as function value. a public method with name get net Price without parameters returning the net price as function value. a public method with name get grossPrice without parameters returning the gross price (gross price = net price + tax) as function value. a pure virtual public method with name print without parameter or return value. 2. Define a class with name Aacessory derived from abstract class Article. This class shall have following members: a private Boolean attribute with name original for an original accessory, a public constructor with three parameters for the article name, the net price and whether it is an original accessory with true as default parameter. The tax rate shall be automatically initialised by the default parameter of class constructor Article a virtual public destructor producing an output “-Aconssory ()” at its call (see examples at the bottom). a virtual publiC method with name print without parameters writing the article name and ” (original accessory)”, if it is an original one (see examples at the bottom). 3) Define a C++11 enumeration class with name operatingSystem and enumeration values unknown, android, ios, macos, linux, proprietary, unix and windows. Define an overloaded output operator << for a textual output of an operating system name (“unknown oS”, “Android os”, “1os”, “MaooS”, “Linux Os”, “proprietary OS”, “Unix OS”, “MS Windows OS”) onto an output stream (see example at the bottom) 4) Define a class with name Device derived from abstract class Artiole. This class shall have following members a private integer attribute with name mainmemory storing the size of the main memory a private attribute with name os for the operating system of the device. a public constructor with four parameters for the article name, the net price, the main memory size and the operating system with default parameter unknown, the tax rate shall be automatically intlalised by the default parameter of class constructor Artiele. Englisch (Vereinigte Staaten) Worter hassan moussa HM Teilen a virtual public destructor producing an output –Device ()- at its call (see examples at the bottom) a public method with name get os without parameter returming the operating system a virtual public method with name print without parameter or returm value outputting the article name, followed by “RAM”, the main memory size, “aB” as well as the operating system (see examples at the bottom) 5) Define a class with name Notebook derived from class Device This class shall have following members: a private string attribute with nane drive. a private Boolean attribute with name convertible for a convertible one. a public constructor with six parameters for the articde name, the net price, the main memory size, the drive, the operating system with default parameter operatingsystem::linux as well as whether it is a convertible with default parameter false, the tax rate shall be initialised automatically by the constructor of the upper class. a virtual public destructor producing an output -Notebook ()” at its call (see examples at the bottom) a public method with name is a convertible without parameters returning a Boolean function value whether the notebook is a convertible. a virtual public method with name print without parameters, caling method print of the direct upper class, in case of a convertible outputs string – (convertible) and afterwards the drive. 61 Deftine a class with name Phone derived from cass Device. This class shall have following members a public constructor with four parameters for the article name, the net price, the main memory size with 4G8 as Defautparameter and the operating system Android OS as default parameter, the tax rate shall be intialised automatically by the constructor of the upper class a virtual public destructor producing an output -Phone () at its call (see examples at the bottom). A vitual putblic method with name print without parameters calling method print of the direct upper class and afterwards outputting “phone” class for an article in the shopping cart with name InCart This class shal have 7) Define a following members a private pointer attribute with name artiole lo an otject of class Artiole a private integer attribute with name amount how many of this article are placed in the shopping cart. a private attribute with name next of type pointer to InCart or bulding up a lst a public constructor with three parameters to ntalise the three attribules of an object the amount shall be 0 as defaull parameter, the pointer to the next article in a shopping cart a null pointer also as defaut parameter a virtual public destructor outputting -Ineart ) and the amount as wed as calling he destructor for the article (see examples at the botom) T0ON ENG VIS Dekument – Word P Suchen rteurt Layout Referenzen Sendungen Oberprufen hamen me M Ansicht Hife Bildformat a public method with name getDext without parameters retuming a pointer to the next article in shopping cart as function value a virtual public method with name print without parameters, outputing the amount, then sending message print to the article in the shopping cart, then in a new ne outputting formatted as in the examples at the botom the single gross price and the total gross price for the chosen amount of articles onto an output stream (see example at the bottom) PROTO IEC- SHOP YOUR SHOPEINGCART ) Define a class for a shopping cart with name shessinecart This class shal have following members 3 TOOLOK 10k Wirelens ouerbask o 34.99 EUR a private pointer attribute with name artieles to the head of a list of artcles in the shopping cart of class InCart • three private real valued attributes with names infressshigping for which purchase value free shpping is offered, mntPrioe for the total net price sum of all articles in the shopping cart and urosstrice for the total gross price sum . a pubic standard constructor patiog an empty shopping cart with both sum vales EUR and the purchase value for free shipping with 1000 EUR a pubic destructor outputting ShospingCart0 and aterwards delting each artide in the shopping cart starting with an output “delete artiele:Such that no memory leak will exst a public method with name aet mintreshipping with one parameter assigning 110.96 EU 93.24 RUR 17.72 gross price 110.96 EUR 5.90 e skerddrye its value to the same named attribute a pubic method with name addLarticle with an amount and a pointer to an article as parameters, adding a new obect Cart on heap to the shopping cart and actang the two sum varatles of the class appropriately a virtual public method with name print without parameters writing a shopping onto the standard output stream cart formated as given in the examples at the bottom Especially the net price sum, the tax (dference gross minus net total sum) and the gross price sum shall be outpfled at the end of the shopping cart. Take care shipping cost output of 5.90 EUR (see example at the bottomy totali 116.86 EU also regard the (may be) PROTO- TEC-SEOP SHOPEINGCART TOUR 9) To test wnte a main function placing some articles as new objects on the heap into an electronc shopping cart ………. 1 ABUS RO Six Scar I 0731, AM 16, S WIdowe os. 312on detine a shoppeng cart object of type shopingCart ung the standard constructor. Send a message to this obgect that the artickes get hee shipping starting hom 500 EUR Add to ths shopping cart a new accessory artice on heap with an amount of three tanks Y0OLOR 10 Wireless Bobnnh Qi with single net price 31.00 EUR being no original accessory Print the complete shopping cart (here are shipping costs) Add to this shopping cart a new smart phone “Samung Galay s10 sH 097S/s Dual KIM wth net price 661.67 EUR, BG8 man memory size and Android O operating system Add to ths shopping cart two new smart phones Apple irhone 11 Pro 256cwih net price 1097 47 EUR, 4GB man memory size and iOS operating system Add to ths shopping carta new nobebookASUS RDO SLEi Sear III G31- with net price 1506 55 EUR, 16GB main memory sie 512on aD Im ssm- as dive and MS Windows operating system Prt again the complete shopping cat now there are no shipping cont) 1087.99 2007.99 EDR 2 Apple Phone 11 Fro 25608, RAM 4a, sos phone 135.3 R 2611.98 2UR 1 Sanung Galasy al0 -o75r/08 Dunl siH, RAM ROR, Andread ca phone T87.39 ua 787.39 EUR 3 YoosOR 10k Mreleaa o as o 36.39 e 110.54 em um at prLOR Engch beigte Steeter Dokument2- Word P Suchen gen Überprüfen Ansicht Hife Bildformat 4536.40 EUR 861.92 EUR tax! sum grosa price: 5398.32 EUR shipping: 0.00 EUR total: 5398.32 EUR -ShenninaCart O delete article: -Incart () 1 -Notebook () -Device () -Article () ASUS ROG Strix Scar III G731 delete articlei -InCart ) 2-Phone () -Device () -Article () Apple 1Phone 11 Pro 2560a delete article: -nCart ) 1 -Phone () -Device () -Article 0 Samsung Galaxy s10+ SM-G9757/DS Dual SIM delete article: -InCart () 3 -Acceasory) -Article() YOOLOX 10k ireless Powehank o1 Article -netPrice -taxRate – model ShoppingCart InCart anicle axt – minFreeShipping -sumNetPrice -sumGrossPrice + ShoppingCano + set_minFreeShipping add articie) * prin) amount articles InCan) * get next) print +Article) + get_netPrice) * grossPrice) + get model) set modelO set netPrice0 printo Device Accessory os ccenumerationas Operatingsystem -original Accessory) + print) – main memory + Devicel) get os) prine) unknown android Ios macOs inux proprietary unix windows Notebook Phone convertible -dive Notebook ia convertibleo prin Phone) prin) Show transcribed image text Dokument2 – Word Suchen Entwurf Layout Referenzen Sendungen Überprüfen Ansicht Hilfe Bildformat 1. Define an abstract base class for an offered article with name Artiole. This class shall have following members: a private string attribute with name model storing the article model name. two private real valued attributes with names netprice for the net price and taxRate storing the tax value in percent of the article. a public constructor with three parameters to initialise the attributes of an object, the tax rate shall be a default parameter with 19 %. a virtual public destructor producing an output “-Article ()” at its call and the article model name (see examples below). a public method with name set model assigning a string parameter to the model name attribute. a public method with name set netPrice assigning the double parameter to the net price attribute. a public method with name get model without parameters returning the model name as function value. a public method with name get net Price without parameters returning the net price as function value. a public method with name get grossPrice without parameters returning the gross price (gross price = net price + tax) as function value. a pure virtual public method with name print without parameter or return value. 2. Define a class with name Aacessory derived from abstract class Article. This class shall have following members: a private Boolean attribute with name original for an original accessory, a public constructor with three parameters for the article name, the net price and whether it is an original accessory with true as default parameter. The tax rate shall be automatically initialised by the default parameter of class constructor Article a virtual public destructor producing an output “-Aconssory ()” at its call (see examples at the bottom). a virtual publiC method with name print without parameters writing the article name and ” (original accessory)”, if it is an original one (see examples at the bottom). 3) Define a C++11 enumeration class with name operatingSystem and enumeration values unknown, android, ios, macos, linux, proprietary, unix and windows. Define an overloaded output operator

Expert Answer


Answer to Dokument2 – Word Suchen Entwurf Layout Referenzen Sendungen Überprüfen Ansicht Hilfe Bildformat 1. Define an abstract …

OR