Question: PLEASE DO NOT COPY PASTE FROM CHEGG/OTHERWISE I'LL REPORT YOU the first question Create a class called Address in Python and describe it in a
PLEASE DO NOT COPY PASTE FROM CHEGG/OTHERWISE I'LL REPORT YOU

the first question Create a class called Address in Python and describe it in a file called address.py to generate objects with the following attributes/instance variables: houseNum- the address of the house on the street street the address of the home on the street province - the province where the house is located city - the city where the house is located The postal code connected with the home address is known as the postal code.. noofApts - the number of apartments connected with the house number (should be set to o) NOTE: All instance variables/fields should be deemed private to implement encapsulation and the following variables in the class: TotalNootAdd-keeps track of how many objects were produced in total. Assume a value of O as the starting point.. NumofAddWithApt - keep track of how many address objects have one or more apartments, Assume a value of O as the starting point. The following methods should also be included in the class definition: an initializer/constructor technique House number and street instance variables have accessor methods. a mutator method to update the number of apartments, you might also need to edit the NumotAddWithApt class variable, if nootApts was zero but is now non-zero) str is a special method that returns structured information for an object, such as the house or nostal code and the number of flats. Given the following as an example... a special method, STE(), that gives formatted information for the object, including the house number, street, city, province, postal code, and number of units. Given the following data (home number, street, city, province, postal code, and number of flats), for example. The particular approach would return the following: 74, Princess Place, Whotown, NL, ALA 282, 2 City, Province: Whotown, NL Num and Street: 74 Princess Place ALA 262 is the postal code. The number of apartments is two. It is necessary to test the class of objects once it has been designed, In a main function, test the defined class Address by executing the following operations: - Using the following four sets of data, create two address objects with apartments and two address objects without apartments: 15,"Catwalk Street", "Catalina", "NB", "CIC 3C3", 233,"Peet Street", "Peterville", "NL", "ALA 121", 1 "ON","AIA 222"20, "Berrybury Close", "Gooseberry", "NS", "AZA 282" 20, "Berrybury Close", "Gooseberry", "NS","AZA 282" Using the specific technique you created, print each object with appropriate labels. Set the first address's number of flats to 3 and print the address's revised information. Set the third address's number of flats to 2 and print the address's revised details.print the total number of address objects that have been produced wojects created print the total number of addresses with apartments Complete the software code below to get the following output based on your knowledge of the problem statement: 66 Happy Street, Happy Town, Newfoundland Num and Street: 66 Happy Street, Happy Town, Newfoundland Num and Street: 66 Happy Street, Happy Town, Newfoundl AIA 121 Postal Code Number of Apartments Catalina, New Brunswick, 15 Catwalk Street, Catalina, New Brunswick, 15 Catwalk Street, Catalina, New Brunswick, 15 Catwalk Street, Catalina, New Brunswick, 15 Cat CLC 303 is the postal code. The number of apartments is two City, Province: Peterville, ON Num and Street: 33 Peet Street ALA 222 is the postal code for Albuquerque, New Mexico. There are no apartments available. City, Province: Gooseberry, NS Num and Street: 20 Berrybury Close Num and Street: 20 Berrybury Close Num and Street: 20 Berrybury Close Num and Street: 20 Berry A2A 2B2 is the postal code. 66 Happy Street City, Province: Happy Town, NE Number of Apartments: 0 Num and Street: 66 Happy Street AIA 121 is the postal code. Name and address: 15 Catwalk Street, Catalina, New Brunswick CC CCCC CCCC CCCC CC CCCC The number of apartments is two, and the address is 33 Peet Street in Peterville, Ontario AA 222 is the postal code. Num and Street: 20 Berrybury Close City, Province: Gooseberry, NS Number of Apartments: 0 Num and Street: 20 Berrybury Close City, Province: Gooseberry, NS AZA 2B2 is the postal code. 66 Happy Street City, Province: Happy Town, NL Number of Apartments: 0 Num and Street: 66 Happy Street AIA 121 is the postal code. The number of apartments is three, and the address is 33 Peet Street in Peterville, Ontario AIA 222 is the postal code. The number of apartments is two. There are 4 addresses in total. There are 3 addresses with apartments in total. Here's the unfinished code: To keep track of addresses with and without apartment numbers, use the HA class. Address of the class: Variables by Class Line 2 TotalNoof Add ino NumOfAddWithApt Creates an Address object using a function Object ( [native code] } method, Assign values to the following private instance variables: houseNum, Hatreet, city, province, postal Code, and no fact: update the variables in the class: Total NoofAdd, Nuno Add WithApt der init (self, Nurmat, ety, Prov, Code, noonApta BhNum #Line 3 aline 4 - cty, cty, cty, cty, cty, cty, cty, cty, cty, Cty, cty, cty, line 6 pCode #ine 5 Pro 7 noofApt Afine TE line 10 + Line 11 FLEne 10 I line 11 TE line 8 + #Line 9 TE line 10+1 #Line 11 TE line 10 +1 #Line 11 TE line 10+1 #Line 11 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line Aline 14 return Eine 15+ Aline 14 return Eine 15 - Aline 14 return Eine 15 - Aline 14 return Eine 15 + Aline 14 return Eine 15 - Aline 14 return Eine 15+ Aline 14 return Eine 15 - Aline 14 return Eine 15 + Aline 14 return Eine 15 - Wil there was no apartment at that address before, F Mulator method to modify the number of apartments Line 16 11 Lino 171 Line 19 aptrino 19 and update the class variable for the number of addresses with apartment def setApt. A special method for printing the Address object, which includes the house number, street, city, province, #postal code, and number of units det (301); return Fine 20 F Define the main function main() as follows: Define det main) as the main function #Create four address objects: two with apartmental main lines and two without main Line 1 (hlank 21) main Line 2 blank 22) #main Line 3 (blank 23) #main Line 4 (blank 24) #main Line 5 (blank 25) #main Line 6((blank 24) Huse the custom method to print each Address object line 5 print >main (blank 25) Fmain Line 6 (print) (blank 26) Line 7 of print #main (blank 27) in line 8 print ma (blank 28) Set the first addon's number of apartments to three and print main Line 9. (blank 29) Line 10: print #main (blank 30) Set the third address's number of flats to 2 and print #main line 11 (blank 31) Line 12: print #main (blank 32) print main Line 8 (blank 27) main Line 7 (blank 27) main Line 8 (blank 27) main Line S (blank 27) main (blank 28) Set the first address's number of flats to 3 and print main Line 9 (blank 299). 30) Print ma on Lino 10 blank Set the third address's number of flats to 2 and print ima on line 11 (blank 31) print) #main tine 12 (blank 32) print("The total number of addresses are:", (blank 33) > main line 13 print("The total number of addresses are:", (blank 33) > Print the number of flats at each address.print("The following are the total number of addresses with apartments: # 14th Main Line (blank 34) invoke the main function() the first question Create a class called Address in Python and describe it in a file called address.py to generate objects with the following attributes/instance variables: houseNum- the address of the house on the street street the address of the home on the street province - the province where the house is located city - the city where the house is located The postal code connected with the home address is known as the postal code.. noofApts - the number of apartments connected with the house number (should be set to o) NOTE: All instance variables/fields should be deemed private to implement encapsulation and the following variables in the class: TotalNootAdd-keeps track of how many objects were produced in total. Assume a value of O as the starting point.. NumofAddWithApt - keep track of how many address objects have one or more apartments, Assume a value of O as the starting point. The following methods should also be included in the class definition: an initializer/constructor technique House number and street instance variables have accessor methods. a mutator method to update the number of apartments, you might also need to edit the NumotAddWithApt class variable, if nootApts was zero but is now non-zero) str is a special method that returns structured information for an object, such as the house or nostal code and the number of flats. Given the following as an example... a special method, STE(), that gives formatted information for the object, including the house number, street, city, province, postal code, and number of units. Given the following data (home number, street, city, province, postal code, and number of flats), for example. The particular approach would return the following: 74, Princess Place, Whotown, NL, ALA 282, 2 City, Province: Whotown, NL Num and Street: 74 Princess Place ALA 262 is the postal code. The number of apartments is two. It is necessary to test the class of objects once it has been designed, In a main function, test the defined class Address by executing the following operations: - Using the following four sets of data, create two address objects with apartments and two address objects without apartments: 15,"Catwalk Street", "Catalina", "NB", "CIC 3C3", 233,"Peet Street", "Peterville", "NL", "ALA 121", 1 "ON","AIA 222"20, "Berrybury Close", "Gooseberry", "NS", "AZA 282" 20, "Berrybury Close", "Gooseberry", "NS","AZA 282" Using the specific technique you created, print each object with appropriate labels. Set the first address's number of flats to 3 and print the address's revised information. Set the third address's number of flats to 2 and print the address's revised details.print the total number of address objects that have been produced wojects created print the total number of addresses with apartments Complete the software code below to get the following output based on your knowledge of the problem statement: 66 Happy Street, Happy Town, Newfoundland Num and Street: 66 Happy Street, Happy Town, Newfoundland Num and Street: 66 Happy Street, Happy Town, Newfoundl AIA 121 Postal Code Number of Apartments Catalina, New Brunswick, 15 Catwalk Street, Catalina, New Brunswick, 15 Catwalk Street, Catalina, New Brunswick, 15 Catwalk Street, Catalina, New Brunswick, 15 Cat CLC 303 is the postal code. The number of apartments is two City, Province: Peterville, ON Num and Street: 33 Peet Street ALA 222 is the postal code for Albuquerque, New Mexico. There are no apartments available. City, Province: Gooseberry, NS Num and Street: 20 Berrybury Close Num and Street: 20 Berrybury Close Num and Street: 20 Berrybury Close Num and Street: 20 Berry A2A 2B2 is the postal code. 66 Happy Street City, Province: Happy Town, NE Number of Apartments: 0 Num and Street: 66 Happy Street AIA 121 is the postal code. Name and address: 15 Catwalk Street, Catalina, New Brunswick CC CCCC CCCC CCCC CC CCCC The number of apartments is two, and the address is 33 Peet Street in Peterville, Ontario AA 222 is the postal code. Num and Street: 20 Berrybury Close City, Province: Gooseberry, NS Number of Apartments: 0 Num and Street: 20 Berrybury Close City, Province: Gooseberry, NS AZA 2B2 is the postal code. 66 Happy Street City, Province: Happy Town, NL Number of Apartments: 0 Num and Street: 66 Happy Street AIA 121 is the postal code. The number of apartments is three, and the address is 33 Peet Street in Peterville, Ontario AIA 222 is the postal code. The number of apartments is two. There are 4 addresses in total. There are 3 addresses with apartments in total. Here's the unfinished code: To keep track of addresses with and without apartment numbers, use the HA class. Address of the class: Variables by Class Line 2 TotalNoof Add ino NumOfAddWithApt Creates an Address object using a function Object ( [native code] } method, Assign values to the following private instance variables: houseNum, Hatreet, city, province, postal Code, and no fact: update the variables in the class: Total NoofAdd, Nuno Add WithApt der init (self, Nurmat, ety, Prov, Code, noonApta BhNum #Line 3 aline 4 - cty, cty, cty, cty, cty, cty, cty, cty, cty, Cty, cty, cty, line 6 pCode #ine 5 Pro 7 noofApt Afine TE line 10 + Line 11 FLEne 10 I line 11 TE line 8 + #Line 9 TE line 10+1 #Line 11 TE line 10 +1 #Line 11 TE line 10+1 #Line 11 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line 13 def getHouseNum Line 12 return line Aline 14 return Eine 15+ Aline 14 return Eine 15 - Aline 14 return Eine 15 - Aline 14 return Eine 15 + Aline 14 return Eine 15 - Aline 14 return Eine 15+ Aline 14 return Eine 15 - Aline 14 return Eine 15 + Aline 14 return Eine 15 - Wil there was no apartment at that address before, F Mulator method to modify the number of apartments Line 16 11 Lino 171 Line 19 aptrino 19 and update the class variable for the number of addresses with apartment def setApt. A special method for printing the Address object, which includes the house number, street, city, province, #postal code, and number of units det (301); return Fine 20 F Define the main function main() as follows: Define det main) as the main function #Create four address objects: two with apartmental main lines and two without main Line 1 (hlank 21) main Line 2 blank 22) #main Line 3 (blank 23) #main Line 4 (blank 24) #main Line 5 (blank 25) #main Line 6((blank 24) Huse the custom method to print each Address object line 5 print >main (blank 25) Fmain Line 6 (print) (blank 26) Line 7 of print #main (blank 27) in line 8 print ma (blank 28) Set the first addon's number of apartments to three and print main Line 9. (blank 29) Line 10: print #main (blank 30) Set the third address's number of flats to 2 and print #main line 11 (blank 31) Line 12: print #main (blank 32) print main Line 8 (blank 27) main Line 7 (blank 27) main Line 8 (blank 27) main Line S (blank 27) main (blank 28) Set the first address's number of flats to 3 and print main Line 9 (blank 299). 30) Print ma on Lino 10 blank Set the third address's number of flats to 2 and print ima on line 11 (blank 31) print) #main tine 12 (blank 32) print("The total number of addresses are:", (blank 33) > main line 13 print("The total number of addresses are:", (blank 33) > Print the number of flats at each address.print("The following are the total number of addresses with apartments: # 14th Main Line (blank 34) invoke the main function()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
