Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an inheritance hierarchy that enables polymorphism for the class here. Part #3 (20 points) ImportedProduct (a Product) (2 points) Attributes countryOfOrigin : a String

Write an inheritance hierarchy that enables polymorphism for the class here.

Part #3 (20 points)

ImportedProduct (a Product) (2 points)

Attributes

  • countryOfOrigin: a String of characters (1 point)
  • tariff: a double value (1 point)

Methods

  • Default Constructor (2 points)
  • Constructor (4 points)
  • set and get methods (4 points)
  • toString: returns information about an ImportedProduct (3 points)
  • calculatePrice: returns the price of an ImportedProduct by adding to the basic price: (3 points)

5% of basic price if country of origin is USA

Amount of tariff

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

Students also viewed these Databases questions

Question

=+j Explain the relationship between unions and MNEs.

Answered: 1 week ago

Question

=+Have they changed the way employees view IP?

Answered: 1 week ago