Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 1 Classes, objects, and interactions Submit a single ZIP file called assignment 1 . zip which must contain an IntelliJ project with your Java
Assignment
Classes, objects, and interactions
Submit a single ZIP file called assignmentzip which must contain an IntelliJ project with your
Java files. You should create the zip by going to File Export Project to Zip File... in
the IntelliJ menu within your project. This assignment has marks total see the marking
scheme included on the assignment page.
Problem Electronics Store Version
Your goal for this problem is to create a simple implementation of an electronics store using the
concepts we have covered in the first two weeks of the course. You do not need to implement
proper encapsulation or apply any of the principles of OOP that are discussed starting in week
# It is advised that you complete the first two tutorials for the course before starting the
assignment.
You must implement the following five 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 fourargument 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 objects properties. Two
examples of what the toString method should return are included below:
Desktop PC with ghz CPU, GB RAM, GB HDD drive.
Desktop PC with ghz CPU, GB RAM, GB 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 fiveargument 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 objects properties. Two examples of what the toString method
should return are included below:
Laptop PC with ghz CPU, GB RAM, GB SSD drive.
Laptop PC with ghz CPU, GB RAM, GB HDD drive.
COMP BCD W A Due Friday, February th at : PM
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 threeargument constructor that accepts an input parameter for each of these
values in the same order they are listed above size freezer, colorThe class must have a
toString method that returns a string indicating the object is a fridge along with the objects
properties. Two examples of what the toString method should return are below:
cubic foot Fridge with Freezer Gray
cubic foot Fridge White
ElectronicStore Class: Must have an instance variable called name to store the name of the
store. Must have a oneargument constructor that accepts a string to specify the store name.
The store must also contain instance variables to store nine items in total Desktops,
Laptops, and Fridges The constructor for this class must create three instances of each
class to initialize these attributes. These objects can be stored in separate variables or within
three separate arrays ie one array for desktops, one for laptops, one for fridges For now,
you should hardcode the argument values for the product constructors ie CPU speed, RAM,
color, etc. You can choose any sensible values for each. This class should also have a void
method called printStock that will print each of the items in the stores stock to the console in
a readable format. Additionally, this class should have a searchStockString method. The
searchStock method should accept a string argument and return true if the toString of any
product in the stores stock contains the given string argument otherwise the method should
return false The searchStock method must be case insensitive. That is searches for desk
and hdd should both return true if the store contains a Desktop PC with ghz CPU, GB
RAM, GB HDD drive
ElectronicStoreTester Class: This class should have a single main method, which will first
instantiate an ElectronicStore and then call the printStock method. The test class should then
repeatedly prompt the user to enter an item to search for. If the user enters the word quit this
process should stop, and the program should end note: if you are comparing two String objects
in Java to see if they are equal, you should use the equals method Otherwise, the
searchStock method of the El
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started