Answered step by step
Verified Expert Solution
Question
1 Approved Answer
L 1 3 Homework: Gym Equipment Problem Description Hello! Please make sure to read all parts of this document carefully. In this assignment, you will
L Homework: Gym Equipment
Problem Description
Hello! Please make sure to read all parts of this document carefully.
In this assignment, you will be applying your knowledge of interfaces and Comparable to write
one interface and some classes that can be used to simulate the management of equipment in
a gym.
Solution Description
You will write one interface, Adjustable, and five classes: FreeWeight, Barbell, Dumbbell,
WeightMachine, and Gym. Each will be written in its own file named accordingly
You must use constructor chaining when it's applicable:
If a class has constructors, it will use "this" constructor chaining times
A class will use "super" constructor chaining at most once. It may only be used in
the constructor that has all the appropriate parameters. You will use it if and
only if in that constructor, the implicit "super" constructor chaining is not
appropriate
Visibility for required elements:
All classes, methods, and constructors must be public
All variables must be private
You may add to aid you if you want
Methods, if they are private
Variables, if they are private static final
You may not add any other classes or constructors
You will also be provided with an additional class, FreeWeightConcrete in an appropriately
named file This class is used for autograding purposes, as we need a way to test the class that
we cannot directly instantiate. You need to familiarize yourself with this class, as it will help
you understand autograder error messages related to the type which it is replacing. This file is
errorfree, and error messages related to it are actually errors about the related type. You
must not change it in any way, and you must submit it along with your other files in your
submission.
Adjustable
It represents objects that can be in some way, adjusted in their weight. This is an interface. It
will have:
boolean adjustWeight int abstract method. The parameter is the desired
adjustment, and the return value is to indicate whether it could be applied successfully.
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