Answered step by step
Verified Expert Solution
Link Copied!

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

L13 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 N constructors, it will use "this" constructor chaining N-1 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
error-free, 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

Why are stakeholders important to accounting ethics

Answered: 1 week ago

Question

You have

Answered: 1 week ago