Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer Part 3) I have posted this question multiple times. Here is the base code and what I have so far This is what it

Answer Part 3) I have posted this question multiple times.

Here is the base code and what I have so far

This is what it should do and look like: https://www.screencast.com/t/Z6NU0nXd

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

public double getRevenue) return revenue: //Prints the stock of the store public void printstock) for(int i ; 1 curProducts; i++) System.out.println(tckli] "stock [i].getQuantity) in stock,stock).getPricedollars each)) public static Electronicstore createStore) Electronicstore storel new Electronicstore( initName: "Watts Up Electronics") Desktop d1 new Desktop(100, 10, 3.0, 16, false, 250, "Compact") Desktop d2 new Desktop(200, 10, 4.0, 32, true, 500, "Server"); Laptop 11 new Laptop 150, 1, 2.5. 16, true, 250, 15): Laptop 12 new Laptop(250, 10, 3.5, 24, true, 500, 16): Fridge f1new Fridge(500, 10, 250, "White", "Sub Zero", 15.5, false): Fridge 12new Fridge(750, 10, 125, "Stainless Steel", "Sub Zero", 23, true): ToasterOven t1 new ToasterOven(25, 10, 50, "Black" "Danby", 8, false); ToasterOven t2 new ToasterOven(75, 10, 50, "silver", "Toasty", 12, true) storel.addProduct(dl); storel.addProduct(d2): storel.addProduct (1); storel.addProduct (12); storel.addProduct (f1); storel.addProduct (12); storel.addProduct(tl); storel.addProduct (t2); return storel; //Class representing a single laptop product public class Laptop extends Computer private double screenSize; public Laptop(double initPrice, int initQuantity, double initCPUSpeed, int initRAM, boolean initsSD, int initStorage, double initScreen) super(initPrice, initQuantity, initCPUSpeed, initRAM, initSSD, initStorage); screensize ntScreen; public String tostring) String result = screensize + " inch Laptop PC with " + getCPUSpeed() + "ghz CPU, " + getRAM() + "GB RAM, " + getStorage() + "GB-; if (getSSDO result SSD drive."; elset result "HDD drive." return result; public double getRevenue) return revenue: //Prints the stock of the store public void printstock) for(int i ; 1 curProducts; i++) System.out.println(tckli] "stock [i].getQuantity) in stock,stock).getPricedollars each)) public static Electronicstore createStore) Electronicstore storel new Electronicstore( initName: "Watts Up Electronics") Desktop d1 new Desktop(100, 10, 3.0, 16, false, 250, "Compact") Desktop d2 new Desktop(200, 10, 4.0, 32, true, 500, "Server"); Laptop 11 new Laptop 150, 1, 2.5. 16, true, 250, 15): Laptop 12 new Laptop(250, 10, 3.5, 24, true, 500, 16): Fridge f1new Fridge(500, 10, 250, "White", "Sub Zero", 15.5, false): Fridge 12new Fridge(750, 10, 125, "Stainless Steel", "Sub Zero", 23, true): ToasterOven t1 new ToasterOven(25, 10, 50, "Black" "Danby", 8, false); ToasterOven t2 new ToasterOven(75, 10, 50, "silver", "Toasty", 12, true) storel.addProduct(dl); storel.addProduct(d2): storel.addProduct (1); storel.addProduct (12); storel.addProduct (f1); storel.addProduct (12); storel.addProduct(tl); storel.addProduct (t2); return storel; //Class representing a single laptop product public class Laptop extends Computer private double screenSize; public Laptop(double initPrice, int initQuantity, double initCPUSpeed, int initRAM, boolean initsSD, int initStorage, double initScreen) super(initPrice, initQuantity, initCPUSpeed, initRAM, initSSD, initStorage); screensize ntScreen; public String tostring) String result = screensize + " inch Laptop PC with " + getCPUSpeed() + "ghz CPU, " + getRAM() + "GB RAM, " + getStorage() + "GB-; if (getSSDO result SSD drive."; elset result "HDD drive." return result

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