Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Spring 2019 Name Erogcamming. Write onty code in the following Do not write any comments Electronics (assuming in Electronics java file) The Preduct class has

image text in transcribed
Spring 2019 Name Erogcamming. Write onty code in the following Do not write any comments Electronics (assuming in Electronics java file) The Preduct class has the following protected instance variables: 5-digit product ID number, 4-digit manufacturer's ID, wholesale price, percent markup from wholesale, .nn and the following public instance methods: constructor without parameters: initialize all of the instance variables to some default values tor with parameters: initialize all of the instance/variables to the arguments construc SetProduct: assign all of the instance variables to the arguments RetailPrice: Returns the retail price, which is wholesale price increased by markup LessThan: Receives a Product object. Returns true iff this product's I number is less than the argument's product ID number toString: Returns the values of all of the instance variables as a string The Electronics class has the following private instance variables: name of the electronics, warranty, warranty charge and the following public instance methods: constructor without parameters: initialize all of the instance variables to some default values, including Product class's instance variables constructor with parameters: initialize all of the instance variables to the arguments, including Product class's instance variables SetElectronics: assign all of the instance variables to the arguments, including Product class's instance variables SalePrice: retail price plus warranty charge An overrided toString: Returns the values of all of the instance variables as a string Please write your complete Product class, Electronies class and a driver elass below a (50 pts) Write your complete Java code for the above two Java classes: Product, Electronics. b (35 pts) Write your test Java class and its main method which will create two Electronics instances: el and e2, el is created with the default constructor, e2 is created with the explicit value constructor. Then update el with calling SetElectronics() method. Calculate both electronics' sale prices and output them. Output both electronics' detailed information. c (15 pts) In your test Java class main method, add more operations: create an ArrayList of five electronics objects and find the one which has the smallest product ID and output all of its information

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions