A shopping cart consists of items. An item can be either a household or an electronic...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A shopping cart consists of items. An item can be either a household or an electronic item. The following UML diagram represents item, household item, electronic item and their relationship. Householditem () discount double (+) Householditem(id: String, description: String unitPrice: double, discount double) (+) computeSale Price(): double (+) toString(): String (-) id: String (-) description: String (-) unitvice: double (-) numberOfitem: Int Mem (+) Item(id String, description: String, unitPrice: double) (+) getNumberOfitem): int () compute Sale Price: double (+) tostring): String Electronicitem (-) warrantyPeriod: int (-) warrantyCost: double (+) Electronicitem (id: String, description: String, unitPrice: double, warrantyPeriod: int, warrantyCost: double) (4) computeSale Price: double (+) toString(): String Given above scenario and UML diagram, complete the following method that will compute the average price of the electronic items in the cart. public static double averageElectronicitem(item 1 cart) 4 // your code here A shopping cart consists of items. An item can be either a household or an electronic item. The following UML diagram represents item, household item, electronic item and their relationship. Householditem () discount double (+) Householditem(id: String, description: String unitPrice: double, discount double) (+) computeSale Price(): double (+) toString(): String (-) id: String (-) description: String (-) unitvice: double (-) numberOfitem: Int Mem (+) Item(id String, description: String, unitPrice: double) (+) getNumberOfitem): int () compute Sale Price: double (+) tostring): String Electronicitem (-) warrantyPeriod: int (-) warrantyCost: double (+) Electronicitem (id: String, description: String, unitPrice: double, warrantyPeriod: int, warrantyCost: double) (4) computeSale Price: double (+) toString(): String Given above scenario and UML diagram, complete the following method that will compute the average price of the electronic items in the cart. public static double averageElectronicitem(item 1 cart) 4 // your code here
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
1. How important is it to have a mix of products? When shoes slack off during the winter, the apparel business picks up. What are the implications of seasonal products? What problems does this create...
-
Write codes as per the following UML diagram (Give arbitrary codes for the methods). Also write driver class to create Dog object and use methods and show output: Animal -age: int + void eat() Dog...
-
An airline company wants to create an online air ticket purchase for its customers. The company wants to attract customers to participate or purchase from its website by offering a discount to the...
-
Suppose that the probability that a mechanic fixes a car correctly is 0.9. Determine the odds against the mechanic fixing a car correctly.
-
Do the expected returns appear to be related to each alternatives market risk? (2) Is it possible to choose among the alternatives on the basis of the information developed thus far?
-
At certain locations geothermal energy in undergound water is available and used as the energy source for a power plant. Consider a supply of saturated liquid water at 150C. What is the maximum...
-
The figure shows a map of the motor control area of the brain, found in the frontal lobe of the cerebrum. Why is such a large part of the brain responsible for controlling the actions of the hands...
-
Slug flow is an idealized tube flow condition for which the velocity is assumed to be uniform over the entire tube cross section. For the case of laminar slug flow with a uniform surface heat flux,...
-
Rapp Corp. has the following inventory information available for June: Date Description Units Cost per unit June 1 Beginning inventory 60 $150 June 5 Sale (50) June 16 Purchase 200 $160 June 25 Sale...
-
Find and classify the stationary values of the function f(x, y) = sin x cos y + 2 cos x sin y in the range 0xm, x y 0syn. fxy 2 fxxfyy-fxy Type f(x,y)
-
The management of Whispering Winds Corp. is trying to decide whether it can increase its dividend. During the current year, it reported net income of $866,000. It had net cash provided by operating...
-
The Flat Company Ltd is famous for its 'Soft Feel' range of yoga mats. The management of the company is considering the production for next year and has asked for help with certain financial...
-
A reporter needs at least $2,431.75 to purchase new camera equipment. She has $150.25 saved and is saving an additional $175.50 each week. Determine how many weeks, w, the reporter needs to save w ...
-
Sofia wants to start her own business but knows little about how to set up an accounting system or interpret financial informatio not worried about accounting, she tells her friends. ill just hire...
-
When purchasing a chef's knife, what are the two most important considerations? brief.
-
what is an example of an ad that cross the line between having a catchy ad and being misleading?
-
A company's beta is 1.7. The risk-free rate is 3.5% and the market risk premium is 6.9%. What is the cost of equity according to the CAPM? A. 13.99% B. 15.23% C. 16.47% D. 17.41% E. 18.95%
-
Create a data model for one of the processes in the end-of-chapter Exercises for Chapter 4. Explain how you would balance the data model and process model.
-
Why do ERP systems need bolt-on software? Give an example of bolt-on software.
-
Explain the outsourcing risk of failure to perform.
-
Prepare the 3NF base tables needed to produce the sales report view shown in the diagram forProblem. NoRMAIZATION OF DATA Sales Report Customer Number: 19321 Customer Name : Jon Smith Address : 520...
-
Why do you think we would want to look at the accounts receivable in the accounting books as often as once a month?
-
Explain how an ABS CDO is structured.
-
Why do you think we would want to draw these two extra lines onto the handwritten account?
Study smarter with the SolutionInn App