Question: Please provide Java code for the question Your goal for this problem is to create a simple implementation of an electronics store. You must implement


Please provide Java code for the question
Your goal for this problem is to create a simple implementation of an electronics store. You must implement the following four classes with the defined functionality Desktop Class: Must store the CPU speed (in Ghz as a double), amount of RAM (in GB as an integer), amount of storage (in GB as an integer), and whether or not the storage is an SSD or HDD (a Boolean, with true meaning SSD and false meaning HDD). The class must have a four argument constructor that accepts an input parameter for each of these values in the same order they are listed above (CPU, RAM, storage, SSD). The class must have a toString method that returns a string indicating the object is a desktop PC along with the object's properties. Two examples of what the toString method could return are included below: Desktop PC with 3.5ghz CPU, 8GB RAM, 500GB HDD drive Desktop PC with 3.0ghz CPU, 16GB RAM, 250GB SSD drive. Laptop Class: Must store the CPU speed (in Ghz as a double), amount of RAM (in GB as an integer), amount of storage (in GB as an integer), whether or not the storage is an SSD or HDD (a Boolean, with true meaning SSD and false meaning HDD), and the screen size (in inches as an integer). The class must have a five-argument constructor that accepts an input parameter for each of these values in the same order they are listed above (CPU, RAM, storage, SSD, screen size). The class must have a toString method that returns a string indicating the object is a laptop PC along with the object's properties. Two examples of what the toString method could return are included below: 15" Laptop PC with 3.1ghz CPU, 32GB RAM, 500GB SSD drive 13" Laptop PC with 2.5ghz CPU, 8GB RAM, 250GB HDD drive Fridge Class: Must store the size of the fridge (in cubic feet, as a double), whether it includes a freezer or not (a Boolean that is true if it has a freezer), and the color (as a String). The class must have a toString method that returns a string indicating the object is a fridge along with the object's properties. Two examples of what the toString method could return are included below 15.6 cubic foot Fridge with Freezer (Gray) 10.5 cubic foot Fridge (White) ElectronicStore Class: Must have a zero-argument constructor. The constructor for this class must create three instances of each of the previous three classes (9 items in total, using the constructors defined in those classes) and store them within the ElectronicStore instance being created. For storage purposes in the ElectronicStore class, you can use one or more arrays or lists (your design choice) to store the products. You can hard-code the argument values for the product constructors (i.e., CPU speed, RAM, color, etc.) or use a random generator to randomly assign them. This class should also have a void method called printStock) that will iterate over all of the store's stock and print them to the console in a readable format. ElectronicStoreTester Class: This class should have a single main method, which will instantiate a single ElectronicStore and call the printStock() method. The output from this tester class should be similar to below The store stock includes Desktop PC with 3.5ghz CPU, 8GB RAM, 500GB HDD drive Desktop PC with 3.0ghz CPU, 16GB RAM, 250GB SSD drive Desktop PC with 4.3ghz CPU, 32GB RAM, 500GB SSD drive 15" Laptop PC with 3.1ghz CPU, 32GB RAM, 500GB SSD drive
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
