Ask Question
20 September, 17:02

Define a class, addresstype, that can store a street address, city, state, and zip code. use the appropriate functions to print and store the address. also, use constructors to automatically initialize the member variables

+3
Answers (1)
  1. 20 September, 20:48
    0
    We will use Python for this task.

    class addrestype (object):

    # Constructor to initialize member variables

    def __init__ (self, addr, city, state, zip):

    self. address = addr

    self. city = city

    self. state = state

    self. zip = zip

    # Function to print the address (overrides behavior of builtin "print")

    def __str__ (self) : return self. address + ", " + self. city + ", " + self. state + ", " + str (self. zip)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Define a class, addresstype, that can store a street address, city, state, and zip code. use the appropriate functions to print and store ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers