Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am working on a assignment about the Java Programming, in Task 2, I need to modify the method listThem() to list out the room

I am working on a assignment about the Java Programming, in Task 2, I need to modify the method listThem() to list out the room like this "The rooms are the kitchen , the ballroom , the conservatory , the billiard room , the library , the study , the hall , the lounge , the dining room.", but I need to use the specified requirement and it is showed in image 1, the image 2 is for me to modify the enum Room.java, and it will be used for Task 3 and Task 4, but I am stucked in Task 2.

Image 1:

image text in transcribed

Image 2:

image text in transcribed

Task 2 The rooms in which the murder might take place are already identified by an enum called Room.java. It contains this method public static void listThem() \{ //Replace this for Task 2 \} This is the method that should produce the list of rooms that follows the list of suspects in the initial example above. Modify this method so it works, ideally 3 COM1003 Java Programming - Assignment 3 even if another room is added to the list. In order to do this you will find the static method values () that all enums, including Room, have a built in. This method returns an array of all the enum objects in the order they were declared. Room already has a to String() method you should use to print them out. The list should start "The rooms are " as in the example. If you do this with a well written method that demonstrate the techniques identified in the marking scheme you can expect to get another 10% so 32% in all and your output, when you run the program Assignment3.java will now include the line about the rooms

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions