Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am working on a assignment about Java Programming, but I am stucked in Task 3, and I need to code a Weapon pickedAtRandom() method,

I am working on a assignment about Java Programming, but I am stucked in Task 3, and I need to code a Weapon pickedAtRandom() method, I have already make a array of alltheweapons to initialize all the weapons, and now I need to pick a random weapon for Task4, but I don't know how to code it, also this assignment cannot use any other packages and just need to use EasyGraphics, EasyPanel, EasyReader and EasyWriter packages.

This is the image about the Weapon.java that I need to modify without adding new methods or packages:

image text in transcribed

This is the guideline:

image text in transcribed

Task 3 The program will not be able to do anything until it has decided who the murderer was, where the murder happened and what the weapon was. The class called Scenario. java deals with this using the following method. publicvoidsetAtRandom(){attackedWith=Weapon.pickedAtRandom();attacker=Suspect.pickedAtRandom();attackedin=RoompickedAtRandom(); This tasks consists of writing the three pickedAtRandom() methods for the three classes Weapon, Suspect and Room. If you do this with well written methods that demonstrate the techniques identified in the marking scheme you can expect to get another 27% (9\% for each method) so 59% in all and your output but when you run Assignment3. java the output will not have chaged. You need to ask the user to guess the answer. That is the next task

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+which it operates?

Answered: 1 week ago

Question

Define the term Working Capital Gap.

Answered: 1 week ago

Question

=+Are there shop stewards?

Answered: 1 week ago