Consider this project has 4 classes as the following (Beside the Test Class): Flat Extends floorNum : int Property + Fla

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Consider this project has 4 classes as the following (Beside the Test Class): Flat Extends floorNum : int Property + Fla

Post by answerhappygod »

Consider This Project Has 4 Classes As The Following Beside The Test Class Flat Extends Floornum Int Property Fla 1
Consider This Project Has 4 Classes As The Following Beside The Test Class Flat Extends Floornum Int Property Fla 1 (257.39 KiB) Viewed 31 times
Consider this project has 4 classes as the following (Beside the Test Class): Flat Extends floorNum : int Property + Flat + Flat ( String, String, int, double, int) - city: String location : String - numOfRooms : int -price: double // Setters & getters Extends + display(): void Property + Property (String, String, int, double ) 1 Setters & getters Villa + display(): void villaNum: int has Swimming Pool :boolean + Villa + Villa ( String, String, int, double, int, boolean ) // Setters & getters + display(): void 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 "printVillasWithSwimPool” that: 1. Receives ArrayList of type Property. 2. Prints details of the Villa 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply