Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have been stuck on this problem for weeks. I am working on a game where a play

ID: 3534709 • Letter: I

Question

I have been stuck on this problem for weeks. I am working on a game where a player has to collect 3 stones and place them in a certain order to unlock a treasure chest and win the treasure.Â

There are 3 jars with stones on the ground. Each stone with its own weight and name. There are also 3 jars on the chest which are initially empty (stones set to null).


The description for this task is:

It is necessary for your program to detect when the player has placed all 3 stones on the chest in the correct order in order to recognise that the game is over. The chest is locked with a combination chosen by the user. A set of 3 stones A,B,C placed on the chest will unlock the chest only if the weight of A plus the weight of B multiplied by the weight of C equals the combination. i.e. A+B*C=combination.Â

Define a method in class Ground called isChestUnlocked() which is public, takes no parameters and returns a boolean. This ethod should return true if and only if all 3 stones have been placed on the treasure chest in the correct order as described above.

When I have finished each task, I upload the code to a checking program which tells me if my code is correct or not. With my code I am getting an incorrect result.

What the output should be: Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â What my output is:

Explanation / Answer

try this and tell me output: https://www.dropbox.com/sh/ulj7p9121l5oclj/J-1_yLU_nk

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote