Question 1 (10 Marks): CLO1, 2, 3,5 Consider this project has 4 classes as the following (Beside the Test Class): Flat E
Posted: Wed Apr 27, 2022 4:59 pm
Question 1 (10 Marks): CLO1, 2, 3,5 Consider this project has 4 classes as the following (Beside the Test Class): Flat Extends foorumint Property city String location String humorRooms Int -price: double -Flat) Flat String String, int double, int Setters & getters Extends - display void - Property • Property (String String, int, double) Setters & getters display()void Villa -ViNumint has Swimming Pool boolean - V) - Vila ( String, String, int double, int, boolean Setters & gatters - display void a A Create class Property B. Create class Flat that inherits from the class Property C. Create class Villa that inherits from the class Property D. In the Test class (in main method), create an ArrayList of the Property objects and name it listOfProperties E. In the Test class (in main method), assume your own objects and add them to the ArrayList listOfProperties. One Object of Property, Two Objects or Flat, Three Objects of Villa. F. In the Test class (in a new method), create a method "getCheapest Property that: 1. Receives ArrayList of type Property. 2. Returns the location of the object that has the lowest price in the ArrayList. G. In the Test class (in a new method), create a method "printVillas withSwimPool" that: 1. Receives ArrayList of type Property 2. Prints details of the Vilia objects in the ArrayList, that have swimming pool. So, hasSwimming Pool is True. H. In the Test class (in main method), test methods created in step F and G.