Question: please answer using java oop. All the posted answer to this question are wrong. thanks for the help. please answer using java. All the posted



The Problem A museum has a number of rooms, each of which has several wall Paintings are exhibited on some or all the walls. Your task is to represent this system in object-oriented manner The museum, cach room, each wall, and each painting has a name and each is represented in sottware by a class. This common property of the name is encapslated in a super class med Entity, this class has a public constructor that takes the name of the entity as its cely parameter All other classes (Museum, Room, Wor, and pointing are subclasses of Your system will thus have classes named Museum, Room Wall Pantins. Entity. The classes should be structured as shown below 1. A field to store the rooms 2. A constructor that sets the name 3. A method that returns a list (java.util) of Painting byacts in the 4. A method to add a Room object. This method has a parameter for the name of the room and creates and returns the room object created Room 1. A field to store the walls 2. A constructor that sets the name 3. A method that retumsa s java.util) of Pointing objects displayed this room 4. A method to add a wall object. This method has a parameter for the name of the wall and creates and returns the Wolf object created 1. A field to store the paintings on this wall 2. A constructor that sets the name 3. A method that retums ist java.util) of Pointing objects displayed on the wall 4. A method to add a Painting object: this is called from the method item2listed under Pointing Fating 1. A constructor that sets the name 2. A method to set the wall on which this painting is displayed, this calls the method item 4) listed under Woll You will have to everride tostrinet) appropriately, throughout Lise generics wherever applicable A Minimal Test The following code shows an idea of the expected functionality. Please remember that I will exercise your program with a more extensive test public static void main(Stringt args{ Museum museus new Museumi: Roon rool nuseun.addRoon): Roon roon2 museum.addRoont"-2) Painting pointing = new Painting "): Painting painting = new Painting?*); wall walli roon.addwall) wall wal12 ron 2. addwall"); painting.se public static void main(String[] args) { Museum museum = new Museun("MI"); Room room1 = museum. addRoom("1"); Room room2 = museum. addRoom("r2"); Painting painting1 = new Painting("p1"); Painting painting2 = new Painting("p2"); Wall walli = room1.addWall("w"); Wall wall2 = room2. addwall("w2"); paintingi.setWallwalll); painting2.setwall wall2): System.out.println(wall1.getPaintings()); System.out.println(wal12.getPaintings()); System.out.println(rooni.getPaintings()); System.out.println(roon2.getPaintings()); System.out.println(museum.getPaintings()); } It produced the following output. (Painting p1 on wall w1] [Painting p2 on wall w2] [Painting pl on wall wil [Painting P2 on wall w2] [Painting pl on wall wi, Painting p2 on wall w2] Documentation and Coding Conventions Follow the requirements described in the coding standards document under Assignments on D2L. Every class should be in a separate java file. Don't forget to document the constructors Also, document the parameters and return values. If a method simply sets a field in the class or gets the value of a field in the class, it need not te documented. Notice the highlighted phrases. For example, in Room, the following method is not a getter. A method that returns a List (java.util) of Painting objects displayed in this room If a method overrides a superclass method, put the annotation @Override in front of that method. If you specify this annotation, there is no need to document the method. Do not abbreviate any words except names of Exception objects (formed by using the first letter of each word in the Exception class) or the parameter to main (args). Do NOT use single letter identifiers such as i andj The Problem A museum has a number of rooms, each of which has several walls. Paintings are exhibited on some or all the walls. Your task is to represent this system in an object-oriented manner. The museum, each room, each wall, and each painting has a name and each is represented in software by a class. This common property of the name is encapsulated in a super class named Entity; this class has a public constructor that takes the name of the entity as its only parameter. All other classes (Museum, Room, Wall, and Painting) are subclasses of Entity. Your system will thus have classes named Museum. Room, Wall, Painting, and Entity. The classes should be structured as shown below Museum 1. A field to store the rooms 2. A constructor that sets the name 3. A method that returns a list java.util) of Painting objects in the museum 4. A method to add a Room object. This method has a parameter for the name of the room and creates and returns the Room object created. Room 1. A field to store the walls 2. A constructor that sets the name 3. A method that returns a List (java.util) of Painting objects displayed in this room 4. A method to add a Wall object: This method has a parameter for the name of the wall and creates and returns the Wall object created. Wall 1. A field to store the paintings on this wall 2. A constructor that sets the name 3. A method that returns a List (java.util) of Painting objects displayed on this wall 4. A method to add a Painting object; this is called from the method (item 2) listed under Painting. Painting 1. A constructor that sets the name 2. A method to set the wall on which this painting is displayed; this calls the method (item 4) listed under Wall You will have to override toString() appropriately, throughout. Use generics wherever applicable. A Minimal Test The following code shows an idea of the expected functionality. Please remember that I will exercise your program with a more extensive test. public static void main(String[] args) { Museum museum = new Museum ("M1"); Room room1 = museum.addRoom ("r1"); museum addRoom(""); Damm public static void main(String[] args) { Museum museum = new Museum ("M1"); Room room1 = museum.addRoom("r1"); Room room2 = museum.addRoom("r2"); Painting painting1 = new Painting("p1"); Painting painting2 = new Painting("p2"); Wall walli = room1.addWall("W1"); Wall wall2 = room2. addWall("w2"); painting1. setWall(walli); painting2. setWall(wall2); System.out.println(wall1.getPaintings() ); System.out.println(wall2.getPaintings()); System.out.println(room1.getPaintings(); System.out.println(room2.getPaintings()); System.out.println (museum.getPaintings()); } It produced the following output. [Painting p1 on wall wi] (Painting p2 on wall w2] [Painting pl on wall wil [Painting p2 on wall w2] [Painting p1 on wall wi, Painting p2 on wall w2]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
