Question: Create a Python Program: Create a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a

Create a Python Program: Create a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a constructor that accepts values for each of the data fields. Also, create a get method for each field. Write an application that creates at least five Apartment objects (The data to create the Apartment objects will come from a file). Then prompt the user to enter a minimum number of bedrooms required, a minimum number of baths required, and a maximum rent the user is willing to pay. Display data for all the Apartment objects that meet the user's criteria or an appropriate message if no such apartments are available. Note: Include the following error checking in your program 1. Apartment number, rent amount, number of bedrooms, and number of baths must be a positive numeric values. If the user enters a negative or non-numeric value, the program should handle the error by either discarding all the values entered and prompting for all new values or only discard the bad value and prompt the user to enter a new value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!