Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need a method that takes the contents of the rest of the program and outputs it to JOptionPane. I am stuck on that, please
I need a method that takes the contents of the rest of the program and outputs it to JOptionPane. I am stuck on that, please help
In this lab, you will be creating several classes that will be related by inheritance. You will also create a simple client class to output the contents of the created objects. Dwelling Class- This class has the following properties: streetAddress String, city String, state String, zip String bedrooms:int, bathrooms:double. In addition to the standard getter/setter methods, the class also has a no-arg constructor that sets all properties to their Java default values. Override the toString) method such that it prints all the properties separated by the 'I' character. House Class - This class inherits from the Dwelling class but also includes the properties: acreage double and garageSize: int (0 means no garage, 1 means one car garage, etc.). Include a no-arg constructor and override the toString() method in a similar fashion as you did for the Dwelling class. Your toString method must use the super keyword. Apartment Class-This class also inherits from the Dwelling class but also include the properties: apptNum String, override the toString) method in a similar fashion as you did for the Dwelling class. Your tostring method must use the laundry boolean (indicates if the appartment has washer and dryer connections). Include a no-arg constructor and super keyword. Assume the following format for the program input file: Example File: Dwelling type (H or A) Street Address City State Zip 1601 East Maple Lane Smallville NC 28443 al bathrooms 9981 Main Street fayetteville NC 28311 Other properties depending on the Dwelling Type Oriver/Test class: You will need to create a main method that passes in the name of the input 1 file using command line arguments. The input file should be opened and your program should read in all the Dweling information into an ArraytistStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started