1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ad-work [718]
4 years ago
11

Write a class named Person with data attributes for a person’s name, address, and telephone number. Next, write a class named Cu

stomer that is a subclass of the Person class. The Customer class should have a data attribute for a customer number, and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Demonstrate an instance of the Customer class in a simple program. PreviousNext
Engineering
1 answer:
sesenic [268]4 years ago
6 0

Answer:

Provided are two Python programs for the problem solution. Find appropriate, the one that suits you for better understanding

Explanation:

<u>FIRST CODE</u>

<u />

class Person:

def __init__(self, name, address, number):

self.name = name

self.address = address

self.number = number

def Name(self):

return self.name

class Customer(Person):

def __init__(self, name, address, number,custNumber,needMailList):

Person.__init__(self,name, address, number)

self.custNumber = custNumber

self.needMailList = needMailList

x = Person("Marge", "Delhi","1245632541")

y = Customer("Homer", "Mumbai", "32514789","11",False)

print(x.name)

print(y.name)

print(x.Name())

<u></u>

<u>SECOND CODE</u>

<u></u>

class Person:

   def __init__(self, name, address, tel_num):

       self.__name = name

       self.__address = address

       self.__tel_num = tel_num

class Customer(Person):

   def __init__(self, name, address, tel_num, cus_num=0, mail=True):

       Person.__init__(self, name, address, tel_num)

       self.__cus_num = cus_num

       self.__mail = mail

   def set_name(self, name):

       self.__name = name

   def set_address(self, address):

       self.__address = address

   def set_tel_num(self, tel_num):

       self.__tel_num = tel_num

   def set_cus_num(self, cus_num):

       self.__cus_num = cus_num

   def set_mail(self, mail):

       self.__mail = mail

   def get_name(self):

       return self.__name

   def get_address(self):

       return self.__address

   def get_tel_num(self):

       return self.__tel_num

   def get_cus_num(self):

       return self.__cus_num

   def get_mail(self):

       return self.__mail

def main():

   n = eval(input('Enter number of customers: '))

   lst = []

   for x in range(n):

       name = input("Enter name: ")

       address = input("Enter address: ")

       cusNum = int(input("Enter customer number: "))

       telNum = input("Enter telephone number: ")

       mail = bool(input("Enter mail id: "))

       c = Customer(name, address, telNum, cusNum, mail)

       lst.append(c)

   for x in range(n):

       print(lst[x].get_name(), lst[x].get_address(), lst[x].get_tel_num(), lst[x].get_cus_num(), lst[x].get_mail())

main()

You might be interested in
2.7. The term route of entry on an SDS refers to the way a
VARVARA [1.3K]

Answer:

(B) O Chemical

Explanation:

The information contained in the SDS is largely the same as the MSDS, except now the SDSs are required to be presented in a consistent user-friendly, 16-section format. This brief provides guidance to help workers who handle hazardous chemicals to become familiar with the format and understand the contents of the SDSs.

The SDS includes information such as the properties of each chemical; the physical, health, and environmental health hazards; protective measures; and safety precautions for handling, storing, and transporting the chemical.

8 0
4 years ago
The skills and content of several subject areas were combined to form a new field known as a meta.........
Mamont248 [21]

Answer:

metacurriculum

Explanation:

6 0
3 years ago
Read 2 more answers
If you could drive one car for the rest of your life what would it be? Type in comments if you want to answer. Mine is either a
grandymaker [24]

Answer:

the kind of car I want to ride for the rest of my life is Lamborghini.

Explanation:

3 0
3 years ago
Diana and Kinsey are put in charge of choosing a mascot for their basketball team. There are fifteen players on the team, but Di
arsen [322]

Answer:

the data are inadequate

Explanation:

<u>If there are 15 people on the team, and only five have been asked about the mascot, </u><u>this means the data collecting is wrong, and the result doesn’t include thoughts of the majority</u>. If Diana and Kinsey want to have adequate data,<u> they should ask as many as possible, if not all players in the team</u>. This would truly show what the majority wants meaning it will show what the team wants. This kind of complete data correcting is the correct one.

6 0
3 years ago
What is the key objective of data analysis
IceJOKER [234]

Answer: The process of data analysis uses analytical and logical reasoning to gain information from the data. The main purpose of data analysis is to find meaning in data so that the derived knowledge can be used to make informed decisions.

3 0
3 years ago
Other questions:
  • An engineering drawing shows the: (A) dimensions, tolerances, cost, and sales or use volume of a component.(B) dimensions, toler
    10·1 answer
  • A refrigerator removes heat from a refrigerated space at 0°C at a rate of 2.2 kJ/s and rejects it to an environment at 20°C. wha
    15·1 answer
  • You are considering building a residential wind power system to produce 6,000 kWh of electricity each year. The installed cost o
    15·1 answer
  • Verizon LTE
    12·1 answer
  • Learning Goal: To use fundamental geometric and statics methods to determine the state of plane stress at the point on an elemen
    8·1 answer
  • Water and air quality are critical issues facing human society.<br><br><br> True<br><br> False
    14·1 answer
  • How many seconds will it take to cross the street at a normal walking pace?
    15·1 answer
  • What are examples of Quality Assurance workplaces? Check all that apply.
    12·2 answers
  • . H<br> Kijwhayhwbbwyhwbwbwgwwgbwbwhwh
    6·2 answers
  • Ur are mean bryce lolololololololollolollolololol
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!