Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
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 Arraytist Also write a method in the same file that outputs the properties of each dweiling in a JOptionPane 98 1 0 means no and 1 means yes 800 Greenhaven Dr Timbuktu 89744 10 7.5 3.8 5673 Lassie Ln Kalamazoo MI 62399 129 Happy Lucky Dr Charlotte NC 28216 6969 Looney Lane Los Angeles

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

=+f) Let P(A) = I (wo) for A Fo, and assume (wg) E o($).

Answered: 1 week ago