Task Create Application Named Teacherhtml Allows Teacher Enter Name Test Scores Student Po Q43820376

Your task is to create an application named teacher.html thatallows a teacher to enter the name and the test scores for astudent at a point of a semester – the scores are as low as 0 andas high as 100. After each entry, the application should continueto prompt the user if they would like to enter another score – theuser must type Y or N. When the user indicates that they have nomore scores to enter for that particular student, the user shouldbe prompted if they would like to enter another student (Y or N)and continue on. Once the user is done entering students and theirscores, each student with their average score should be displayedin one alert box. Entering Student Names • Should not be empty • Ifit is empty, the user should continually be asked to enter untilcorrect • All of this logic should exist inside one functionEntering Student Scores • Should not be empty • Should be between 1– 100 inclusive • If invalid, the user should continually be askedto enter until correct • All of this logic should exist inside asecond function Entering Whether There is Another Score OR WhetherThere is Another Student • Should not be empty • Can only be Y or yor N or n • If invalid, the user should continually be asked toenter until correct. NOTE: The message should be specific as towhether or not the user should be entering another student oranother score. Watch the demo video for further clarification. •All of this logic should exist inside a third function CalculatingAverage • All of the logic that determines the average score shouldexist inside a fourth function. Storing Each student’s Name andAverage Score • Each student name must be stored inside an array •Each average score for each student must be stored inside adifferent array • For example, after all of the students and theirscores are entered, two arrays like the following should have beenbuilt dynamically (as in, you don’t manually type this in…thesearrays are built while the program runs): var students = [“Paul”,“Sarah”, “Chet”]; var scores = [99, 2, 88]; • In this example,Paul’s average score is 99, Sarah’s is 2, and Chet’s is 88. (Paulis element 0 in both arrays, Sarah is element 1, and Chet iselement 2). Displaying the Final Output • The output should looklike (names and scores may differ): Test Data – WATCH THIS DEMOVIDEO • The Test data that will be used to ensure the program worksis as follows Name Score Score Score Score Paul 100 98 95 100 Sarah4 8 Chet 88 34 100 o Paul’s average should be 98% o Sarah’s averageshould be 6% o Chet’s average should be 74% • I will also betesting that names and scores cannot be left blank • I will also betesting that scores are between 1 and 100 inclusive • I will alsobe testing that only Y or y or N or n are valid answers to whetheror not I would like to add another score or another student andthat the invalid message is specific to whether I was entering ascore or a student (Javascript)

The problem is that i need it while looped. please help.

my code:

<script>

   var averageScore = new Array();
   var stName = new Array();
   var score = 0;
   var numberOfSubject = 0;

   enterStudentName();

   function enterStudentName(x){
   {
   var addName = prompt(“Enter Student Name”);
   }

   if(addName == null || addName == “”)
   {
      
   alert(“Cannot leave field blank. Enter again”);

   return(x);
   }

   else{

   stName.push(addName);

   enterScore();
   }

}

   function enterScore(){

   var promtScore = prompt(“Enter Student Score”);

   if(promtScore == null || promtScore == “” ||promtScore < 0 || promtScore > 100){

   alert(“Score cannot be null or less than 0 or morethan 100”);
   }

   else{

   score = score + parseInt(promtScore);
  
   console.log(score);

   numberOfSubject++;

   console.log(numberOfSubject);

   optionCheckScore();

}

}

   function optionCheckScore(){

   var nextScore = prompt(“Enter another score? Y orN”);

   if(nextScore==”Y”||nextScore==”y”){

   enterScore();

   }

   else if(nextScore==”N”||nextScore==”n”){

   var average = score / numberOfSubject ;

   score = 0;

   numberOfSubject = 0;

   averageScore.push(average);

   optionCheckStudent();

   }

   else{

   alert(“Invalid Option. Enter another score? Y orN”);

}

}

   function optionCheckStudent(){

   var nextStudent = prompt(“Enter Another Student? Yor N”);

   if(nextStudent==”Y”||nextStudent==”y”){

   enterStudentName();

   }

   else if(nextStudent==”N”||nextStudent==”n”){

   displayOutput();

   }

   else{

   alert(“Invalid Option. Enter another student? Y orN”);

}

}

   function displayOutput(){

   var output = “”;

   for(var i = 0;i < stName.length; i++){

   output = “n” + output + stName[i] + ” – ” +averageScore[i] + “% n”;

}

output = “**STUDENT/SCORES** n” + output;

alert(output);;

var outputHTML = “”;

for(var i = 0;i < stName.length; i++){

outputHTML = outputHTML + “<br>” + stName[i] + ” – ” +averageScore[i] + “% <br>”;

}

document.getElementById(“output”).innerHTML =”**STUDENT/SCORES** <br>” + outputHTML;

}

</script>

Expert Answer


Answer to Your task is to create an application named teacher.html that allows a teacher to enter the name and the test scores for…

Task Following Loop Conditions Would Ensure Hi Printed Exactly 5 Times Int X 2 Systemprint Q43842880

TASK: Which of the following do-while loop conditions would ensure that hi is printed exactly 5 times? int x = 2; do { SystTASK: Which of the following do-while loop conditions would ensure that “hi” is printed exactly 5 times? int x = 2; do { System.out.println(“hi”) if (x % 3 = ) { X + 4; else { X – 1; } while( ??? ); Select all correct options from the list X == 1 U x <= 4 1 point per submission Submit Show transcribed image text TASK: Which of the following do-while loop conditions would ensure that “hi” is printed exactly 5 times? int x = 2; do { System.out.println(“hi”) if (x % 3 = ) { X + 4; else { X – 1; } while( ??? ); Select all correct options from the list X == 1 U x

Expert Answer


Answer to TASK: Which of the following do-while loop conditions would ensure that “hi” is printed exactly 5 times? int x = 2; do {…

Task Lab Write Program Move Knight Around Empty Chess Board Leaving Behind Trail Increasin Q43842719

Your task in this lab is to write a program that will move aknight around an empty chess board, leaving behind a trail ofincreasing integers, ranging from 1 to, hopefully, 64. Here are thespecifications for your assignment: 1. The knight will start infirst row and first column (list[0][0]). 2. The program will marksquares as they are visited, ranging from 1-64. 3. The program willcontinue until a complete tour is accomplished (all 64 squares) orthe program gets stuck with nowhere to go. 4. The program willprint the results, looking something like this (use t to align thecolumns):

1 0 21 0 0 14 23 12
20 0 6 9 22 11 0 0
7 2 19 36 15 46 13 24
0 5 8 47 10 37 0 45
0 18 3 16 35 44 25 38
4 31 34 0 42 39 28 0
0 0 17 32 29 26 43 40
0 33 30 0 0 41 0 27
47 squares were visited
5. Use Math.random() to generate the necessary randomnumbers.
6. You will have an OOP class and a client class.
7. Look on the next page for a suggestion on a way to solve thislab.

Provided OOP template

public class Knight {

private int[][] myBoard;

private static final int[] VERT = {1, 2, 2, 1, -1, -2, -2,-1};

private static final int[] HOT = {-2, -1, 1, 2, 2, 1, -1,-2};

private int myRow;

private int myCol;

private int myCount;

public Knight(){

}

public void printBoard() {

}

public void makeMove() {

}

private boolean isLegalMove(int row, int col){
  
}

public boolean isStuck(){

}
}

Expert Answer


Answer to Your task in this lab is to write a program that will move a knight around an empty chess board, leaving behind a trail …

Task Many Times Hello Printed Running Following Code Int X 3 X 20 Systemprintln Hello X 2 Q43842879

TASK: How many times will hello be printed after running the following code? int x = 3; while(x < 20) { System.out.println(TASK: How many times will “hello” be printed after running the following code? int x = 3; while(x < 20) { System.out.println(“hello”); if (x % 2 == 0) { x += 3; continue; else { –x; if (x % 3 == 0) { x += 2; Show transcribed image text TASK: How many times will “hello” be printed after running the following code? int x = 3; while(x

Expert Answer


Answer to TASK: How many times will “hello” be printed after running the following code? int x = 3; while(x < 20) { System.out.pri...

Task Parts D Look Tree Shown Respective Figure Shown Carry Operation Respective Task Part Q43803775

In task parts a) to d), look at the tree that is shown in therespective figure
is shown. Carry out the operation of the respective task part andthe associated
Restructuring measures to preserve the AVL property on thecorresponding
Tree out. Draw the result after every single operation
Insert, Delete and Restructure in a separate tree.a) DELETE(T1, 42) c) INSERT(T3, 23) Tii T3: 30 b) INSERT(T2, 12) d) INSERT(T4, 32)

a) DELETE(T1, 42) c) INSERT(T3, 23) Tii T3: 30 b) INSERT(T2, 12) d) INSERT(T4, 32) Show transcribed image text a) DELETE(T1, 42) c) INSERT(T3, 23) Tii T3: 30 b) INSERT(T2, 12) d) INSERT(T4, 32)

Expert Answer


Answer to In task parts a) to d), look at the tree that is shown in the respective figure is shown. Carry out the operation of th…

Task Perform Normalization Crude Dataset Could Stored Relational Database Metrocabs Privat Q43783265

In this task, you will perform normalization on a crude datasetso that it could be stored as a relational database. MetroCabs is aprivate taxi company that offers cab hire services to their regularbusiness clients. You are provided the following data about some oftheir recent services. The data includes important details on whichclient hired a taxi on given dates. MetroCabs has a small number offull-time drivers who drive different cars based on vehicleavailabilityHIGH HALILOLIVIT on a truue dataset so that it could be stored as a relational database. MetroCabs is a private taxi company

Given the information in above table,

1. Draw a dependency diagram to show the functional dependenciesexisting between columns. State any assumptions you make about thedata and the attributes shown in the table. (3 marks)

2. Show the step by step process of decomposingthe above table into a set of 3NF relations. (5 marks)

3. Review the design of your 3NF relations and make necessaryamendments to define proper PKs, FKs and atomic attributes. Makesure all of your attributes conform to the naming conventions. (3marks)

4. Draw the Crow’s Foot ERD to illustrate your final design. (4marks)

HIGH HALILOLIVIT on a truue dataset so that it could be stored as a relational database. MetroCabs is a private taxi company that offers cab hire services to their regular business clients. You are provided the following data about some of their recent services. The data includes important details on which client hired a taxi on given dates. MetroCabs has a small number of full-time drivers who drive different cars based on vehicle availability. Client ID Client Name Cab ID 2 6 Driver Name Jeffrey Etheridge Driver’s License Number 924765319 Cab Hire Time 5/09/2019 14:20 7/09/2019 11:00 12/09/2019 16:45 Cab Details Subaru Impreza 2015 Toyota Camry 2007 Honda Civic 2009 124 Shaun Pickup Address 6 Kambara Dr, Mulgrave 14 Gainsborough Ave, Wheelers Hill 6 Kambara Dr, Mulgrave 52 Brunswick Rd, Mitcham 8 Columbia Ave, Croydon Sam Harper 740872473 18 6/09/2019 20:10 Sanjay Ugle 843785124 345 Patrick 34 Ford Falcon 2010 Jeffrey Etheridge 924765319 Vipul Jad 6/09/2019 22:30 3/09/2019 09:00 12/09/2019 13:15 15/09/2019 18:05 723596201 521087243 209 Sarah Toyota Camry 2007 Ford Falcon 2010 Holden Commodore 2012 21 Devon St, Chaltenham 34 29 Ishan Mishra Sam Harper 740872473 Show transcribed image text HIGH HALILOLIVIT on a truue dataset so that it could be stored as a relational database. MetroCabs is a private taxi company that offers cab hire services to their regular business clients. You are provided the following data about some of their recent services. The data includes important details on which client hired a taxi on given dates. MetroCabs has a small number of full-time drivers who drive different cars based on vehicle availability. Client ID Client Name Cab ID 2 6 Driver Name Jeffrey Etheridge Driver’s License Number 924765319 Cab Hire Time 5/09/2019 14:20 7/09/2019 11:00 12/09/2019 16:45 Cab Details Subaru Impreza 2015 Toyota Camry 2007 Honda Civic 2009 124 Shaun Pickup Address 6 Kambara Dr, Mulgrave 14 Gainsborough Ave, Wheelers Hill 6 Kambara Dr, Mulgrave 52 Brunswick Rd, Mitcham 8 Columbia Ave, Croydon Sam Harper 740872473 18 6/09/2019 20:10 Sanjay Ugle 843785124 345 Patrick 34 Ford Falcon 2010 Jeffrey Etheridge 924765319 Vipul Jad 6/09/2019 22:30 3/09/2019 09:00 12/09/2019 13:15 15/09/2019 18:05 723596201 521087243 209 Sarah Toyota Camry 2007 Ford Falcon 2010 Holden Commodore 2012 21 Devon St, Chaltenham 34 29 Ishan Mishra Sam Harper 740872473

Expert Answer


Answer to In this task, you will perform normalization on a crude dataset so that it could be stored as a relational database. Met…

Task Perform Normalization Crude Dataset Could Stored Relational Database Metrocabs Privat Q43803525

In this task, you will perform normalization on a crude datasetso that it could be stored as a relational database.

MetroCabs is a private taxi company that offers cab hireservices to their regular business clients. You are provided thefollowing data about some of their recent services. The dataincludes important details on which client hired a taxi on givendates. MetroCabs has a small number of full-time drivers who drivedifferent cars based on vehicle availability.

Client IDClient NameCab Hire TimeCab IDCab DetailsPickup AddressDriver NameDriver’s License Number124Shaun5/09/2019 14:2026Subaru Impreza 20156 Kambara Dr, MulgraveJeffrey Etheridge9247653197/09/2019 11:0011Toyota Camry 200714 Gainsborough Ave, Wheelers HillSam Harper74087247312/09/2019 16:4518Honda Civic 20096 Kambara Dr, Mulgrave345Patrick6/09/2019 20:1034Ford Falcon 201052 Brunswick Rd, MitchamSanjay Ugle8437851246/09/2019 22:308 Columbia Ave, CroydonJeffrey Etheridge924765319209Sarah3/09/2019 09:0011Toyota Camry 200721 Devon St, ChaltenhamVipul Jad72359620112/09/2019 13:1534Ford Falcon 2010Ishan Mishra52108724315/09/2019 18:0529Holden Commodore 2012Sam Harper740872473

Given the information in above table,

4. Draw the Crow’s Foot ERD to illustrate your final design. (4marks)

For guidance on how to normalise database relations from adependency diagram, watch this very short video:https://www.youtube.com/watch?v=vkUyuLLgmwQ

All dependency diagrams and ERD must be created using a drawingtool. Hand-drawn diagrams are NOT acceptable.

Expert Answer


Answer to In this task, you will perform normalization on a crude dataset so that it could be stored as a relational database. Met…

Task Programming Assignment Write Python Program Implements Simple Vehicle Class Class Mod Q43831963

Your task in this programming assignment is to write a Pythonprogram that implements a simple

vehicle class. The class models a vehicle that has a year, amake, and a model (e.g., 2016 Dodge Ram,

2007 Honda Civic, etc). For a 2016 Dodge Ram, for example, theyear is 2016, the make is Dodge, and

the model is Ram. You will be provided a template that includescode (that you cannot change) in the

main part of the program to test the vehicle class:

# ***DO NOT MODIFY OR REMOVE ANYTHING BELOW THIS POINT!***

# the main part of the program

v1 = Vehicle(“Dodge”, “Ram”)

v2 = Vehicle(“Honda”, “Odyssey”)

print “v1={} {}”.format(v1.make, v1.model)

print “v2={} {}”.format(v2.make, v2.model)

print

v1.year = 2016

v2.year = 2016

print “v1={} {} {}”.format(v1.year, v1.make, v1.model)

print “v2={} {} {}”.format(v2.year, v2.make, v2.model)

print

v1.year = 1999

v2.model = “Civic”

v2.year = 2007

print “v1={} {} {}”.format(v1.year, v1.make, v1.model)

print “v2={} {} {}”.format(v2.year, v2.make, v2.model)

This sample code should provide some details of how to structureyour vehicle class. Here’s what the

output of this code with a correctly implemented vehicle classlooks like:

v1=Dodge Ram

v2=Honda Odyssey

v1=2016 Dodge Ram

v2=2016 Honda Odyssey

v1=2016 Dodge Ram

v2=2007 Honda Civic

To help clarify, here are some specifics and/or constraints:

(1) The constructor must take two parameters, make and model,and make proper use of mutators to

set these values;

(2) By default, a newly instantiated vehicle has a year of2000;

(3) Accessors and mutators (using the decorator method discussedin class) for each instance

variable (i.e., year, make, and model) must be included;

(4) A vehicle must have a year that is between 2000 and 2018inclusive (i.e., implement range

checking so that any other provided value is ignored);

(5) You must include a meaningful header, use good coding style,use meaningful variable names,

and comment your source code where appropriate;

(6) Your output should be exactly like the sample run shownabove; and

(7) You must submit your source code as a single .py file.

Expert Answer


Answer to Your task in this programming assignment is to write a Python program that implements a simple vehicle class. The class …

Task Single Inheritance Static Dynamic Binding Shall Trained Simple Extendable Electronic Q43866810

In this task single inheritance with static and dynamic bindingshall be trained. For this a simple and extendable electronicshopping cart shall be programmed. As example articles smartphones, notebooks and accessories shall be ordered (due to clarityin the UML class diagram below data types, parameters anddestructors are omitted.)

Article InCart Shopping Cart article next - netPrice - taxRate - model + amount articles + InCart() + get_next() + print() +

Subtask 2 Subtask 1 Define an abstract base class for an offered article with name Article. This class shall have following m

Subtask 5 Define a class with name Notebook derived from class Device. This class shall have following members: Subtask 7 Def

Subtask 9

To test write a main function placing somearticles as new objects on the heap into an electronic shoppingcart:

  • define a shopping cart object of typeShoppingCart using the standard 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 WirelessPowerbank Qi” with single net price 31.08 EUR being nooriginal accessory.
  • Print the complete shopping cart (there are shippingcosts).
  • Add to this shopping cart a new smart phone “SamsungGalaxy S10+ SM-G975F/DS Dual SIM” with net price 661.67EUR, 8GB main memory size and Android OS operating system
  • Add to this shopping cart two new smart phones “AppleiPhone 11 Pro 256GB” with net price 1097.47 EUR, 4GB mainmemory size and iOS operating system.
  • Add to this shopping cart a new notebook “ASUS ROGStrix Scar III G731” with net price 1586.55 EUR, 16GB mainmemory size,  “512GB SSD + 1TB SSHD” asdrive and MS Windows operating system.
  • Print again the complete shopping cart (now there are noshipping costs).

With the end offunction  mainautomatically the complete shopping cart object gets deleted; yourprogram shall show the outputs of the destructor calls like in theexample given below.

Example program run:

PROTO-TEC-SHOP YOUR SHOPPING CART 3 YOOLOX 1ek Wireless Powerbank Qi 36.99 EUR 119.96 EUR sum net price: tax: sum gross price

Article InCart Shopping Cart article next – netPrice – taxRate – model + amount articles + InCart() + get_next() + print() + Article() + get_netPrice) + get grossPrice) + get_model() + set_model() + set_netPrice() + printo – minFree Shipping – sumNetPrice – sumGrossPrice + Shopping Cart + set_min Free Shipping) + add_article) + print() Device – main_memory Accessory – original + Accessory + printi) Os <cenumeration>> Operating System + Device() + get_os() + print) unknown android iOS macOS linux proprietary unix windows Phone Notebook + Phone() + print) – convertible – drive + Notebook) + is a convertible() + print) Beispiel Warenkorb/Example Shopping Cart Shopping Cart minFreeShipping: sumNetPrice: sumGrossPrice: articles: 500.00 4536.40 5398.32 :InCart In Cart :InCart :InCart article: article: amount: next: 1 article: amount: next: 2 article: amount: next: 1 amount: next: Article :Article Article Article Subtask 2 Subtask 1 Define an abstract base class for an offered article with name Article. This class shall have following members: Define a class with name Accessory 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 “-Accessory0” 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). 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.netPcise 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. . Subtask 3 • Define a C++11 enumeration class with name Operating System 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”, “OS”, “MacOS”, “Linux OS”, “proprietary OS”, “Unix OS”, “MS Windows OST) onto an output stream (see example at the bottom). . . Subtask 4 Define a class with name Device derived from abstract class Article. This class shall have following members: . a private integer attribute with name main..memory 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 initialised by the default parameter of class constructor Article. a virtual public destructor producing an output “-Device()” at its call (see examples at the bottom). a public method with name getos without parameter returning the operating system. a virtual public method with name print without parameter or return value outputting the article name, followed by “RAM”, the main memory size, “GB” as well as the operating system (see examples at the bottom). Subtask 5 Define a class with name Notebook derived from class Device. This class shall have following members: Subtask 7 Define a class for an article in the shopping cart with name InCart. This class shall have following members: • • . a private string attribute with name drive a private Boolean attribute with name convertible for a convertible one. a public constructor with six parameters for the article name, the net price, the main memory size, the drive, the operating system with default parameter Operating System::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, calling method print of the direct upper class, in case of a convertible outputs string “(convertible)” and afterwards the drive. Subtask 6 Define a class with name Phone derived from class Device. This class shall have following members: a private pointer attribute with name article to an object of class Article. 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 for building up a list. A public constructor with three parameters to initialise the three attributes of an object; the amount shall be 0 as default parameter, the pointer to the next article in a shopping cart a null pointer also as default parameter. a virtual public destructor outputting “-Incarto” and the amount as well as calling the destructor for the article (see examples at the bottom). a public method with name get next without parameters returning a pointer to the next article in shopping cart as function value. a virtual public method with name print without parameters, outputting the amount, then sending message print to the article in the shopping cart, then in a new line outputting formatted as in the examples at the bottom the single gross price and the total gross price for the chosen amount of articles onto an output stream (see example at the bottom). Subtask 8 Define a class for a shopping cart with name Shopping Cart. This class shall have following members . • a public constructor with four parameters for the article name, the net price, the main memory size with 4GB as Defaultparameter and the operating system Android OS as default parameter, the tax rate shall be initialised 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 virtual public method with name print without parameters calling method print of the direct upper class and afterwards outputting “phone”. • • a private pointer attribute with name articles to the head of a list of articles in the shopping cart of class In Cart three private real valued attributes with names minFress Shipping for which purchase value free shipping is offered, sumNetPrice for the total net price sum of all articles in the shopping cart and sumGrossPrice for the total gross price sum. a public standard constructor initialising an empty shopping cart with both sum values 0 EUR and the purchase value for free shipping with 1000 EUR a public destructor outputting “-Shopping Carto” and afterwards deleting 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 minFree Shipping with one parameter assigning its value to the same named attribute. a public method with name add article with an amount and a pointer to an article as parameters, adding a new object InCart on heap to the shopping cart and actualising the two sum variables of the class appropriately. a virtual public method with name print without parameters writing a shopping onto the standard output stream cart formatted as given in the examples at the bottom. Especially the net price sum, the tax (difference gross minus net total sum) and the gross price sum shall be outputted at the end of the shopping cart. Take care to also regard the (may be) shipping cost output of 5.90 EUR (see example at the bottom)! PROTO-TEC-SHOP YOUR SHOPPING CART 3 YOOLOX 1ek Wireless Powerbank Qi 36.99 EUR 119.96 EUR sum net price: tax: sum gross price: 93.24 EUR 17.72 EUR 119.96 EUR shipping: 5.99 EUR total: 116.86 EUR +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PROTO-TEC-SHOP YOUR SHOPPING CART ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 ASUS ROG Strix Scar III 6731, RAM 16GB, MS Windows os, 512GB SSD + 1TB SSHD 1887.99 EUR 1887.99 EUR 2 Apple iPhone 11 Pro 256GB, RAM 4GB, iOS phone 1305.99 EUR 2611.98 EUR 1 Samsung Galaxy S18+ SM-G975F/DS Dual SIM, RAM 8GB, Android os phone 787.39 EUR 787.39 EUR 3 YOOLOX 1ek Wireless Powerbank Qi 36.99 EUR 110.96 EUR sum net price: tax: sum gross price: 4536.40 EUR 861.92 EUR 5398.32 EUR shipping: 0.00 EUR total: 5398.32 EUR ShoppingCart() delete article: InCart() 1 Notebook () –Device() -Article() ASUS ROG Strix Scar III G731 delete article: -Incart() 2 Phone() –Device() –Article() Apple iPhone 11 Pro 256GB delete article: -Incart() 1 -Phone() –Device() –Article() Samsung Galaxy S18+ SM-G975F/DS Dual SIM delete article: -Incart() 3 -Accessory() -Article() YOOLOX 1ek Wireless Powerbank Qi Show transcribed image text Article InCart Shopping Cart article next – netPrice – taxRate – model + amount articles + InCart() + get_next() + print() + Article() + get_netPrice) + get grossPrice) + get_model() + set_model() + set_netPrice() + printo – minFree Shipping – sumNetPrice – sumGrossPrice + Shopping Cart + set_min Free Shipping) + add_article) + print() Device – main_memory Accessory – original + Accessory + printi) Os > Operating System + Device() + get_os() + print) unknown android iOS macOS linux proprietary unix windows Phone Notebook + Phone() + print) – convertible – drive + Notebook) + is a convertible() + print) Beispiel Warenkorb/Example Shopping Cart Shopping Cart minFreeShipping: sumNetPrice: sumGrossPrice: articles: 500.00 4536.40 5398.32 :InCart In Cart :InCart :InCart article: article: amount: next: 1 article: amount: next: 2 article: amount: next: 1 amount: next: Article :Article Article Article
Subtask 2 Subtask 1 Define an abstract base class for an offered article with name Article. This class shall have following members: Define a class with name Accessory 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 “-Accessory0” 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). 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.netPcise 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. . Subtask 3 • Define a C++11 enumeration class with name Operating System and enumeration values unknown, android, iOS, macos, linux, proprietary, unix and windows. Define an overloaded output operator

Expert Answer


Answer to In this task single inheritance with static and dynamic binding shall be trained. For this a simple and extendable elect…

Task Value Totalsum Running Following Code Int Totalsum 0 Int 1 9 2 Totalsum Q43842877

TASK: What will be the value of totalSum after running the following code? int totalSum = 0; for(int i = 1; i < 9; i += 2) {TASK: What will be the value of totalSum after running the following code? int totalSum = 0; for(int i = 1; i < 9; i += 2) { totalsum += i; } Show transcribed image text TASK: What will be the value of totalSum after running the following code? int totalSum = 0; for(int i = 1; i

Expert Answer


Answer to TASK: What will be the value of totalSum after running the following code? int totalSum = 0; for(int i = 1; i < 9; i += ...