• Want to take part in this year's BoS Trials event for Maths and/or Business Studies?
    Click here for details and register now!
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page

Java help please! (1 Viewer)

Jackiehanna1

New Member
Joined
Oct 28, 2014
Messages
1
Gender
Female
HSC
N/A
I'm a beginner in Java and was stuck while doing this exercise. Would someone be able to help by showing me the correct java code for this task?

Define a public class Chest according to the following description.
A Chest has an integer “combination”, an integer “position” and 3 jars (“jar1”, “jar2” and “jar3”).
The constructor for class Chest should read the combination from the user according to the
following I/O:
Enter chest combination (5-10): 7
The chest should be created at position 4, and 3 empty jars should be created at the same position as
the chest itself.
Update the definition of class Ground to reflect that the ground has 1 player, 3 jars and a chest.
Before continuing, make any necessary changes to your existing code to ensure that all constructors,
methods and classes are public and all fields are private.
 

Katsumi

Super Moderator
Super Moderator
Joined
May 15, 2014
Messages
2,113
Location
Sydney, Australia
Gender
Male
HSC
N/A
progfunassignment/10

While i can help you, i refuse to legitimately do a portion of the assignment for you.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top