Question

USING PYTHON!!! Get and Set Functions Create get and set member functions for the data members:...

USING PYTHON!!!

Get and Set Functions

Create get and set member functions for the data members:

dbltax

tage

name

lpayrate

age

0 0
Add a comment Improve this question Transcribed image text
Answer #1

# getter method

def getDBLTax(self):

    return self.dbltax

   

def getTAge(self):

    return self.tage

   

def getName(self):

    return self.name

   

def getAge(self):

    return self.age

   

   

# setter method

def setDBLTax(self, dbltax):

    self.dbltax = dbltax

   

def setTAge(self, tage):

    self.tage = tage

   

def setName(self, name):

    self.name = name

   

def setAge(self, age):

    self.age = age

Add a comment
Know the answer?
Add Answer to:
USING PYTHON!!! Get and Set Functions Create get and set member functions for the data members:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment...

    Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of 100 accounts. Use an array of pointers to objects for this. However, your...

  • In python Create a class that holds personal data: name, address, age, and phone number. Write...

    In python Create a class that holds personal data: name, address, age, and phone number. Write the necessary get (accessor) and set mutator methods. Also include a program that creates three instances of the class. This could be you and 2 friends or 2 family members.

  • Using c++ 1. Create a class Produce with the following data members: name, origin, and unitPrice....

    Using c++ 1. Create a class Produce with the following data members: name, origin, and unitPrice. 2. Produce should also have the following member functions: a. setValues to set the name, origin, and unitPrice b. getName to return the name of the Produce c. getOrigin to return the origin of the Produce d. getUnitPrice to return the unitPrice of the Produce e. getPrice to return the price of the Produce when given a certain amount of pounds using the following...

  • Using C#, Create a date class with integer data members for year, month, and day. Also...

    Using C#, Create a date class with integer data members for year, month, and day. Also include a string data member for the name of the month. Include a method that returns the month name as string as part of the date. Separate the day from the year with comma in the method. Include appropriate constructor, properties, and methods. Override the ToString() method to display the date formatted with slashes(/) separating the month, day, and year. Create a second class...

  • in c++ Define and implement the class Employee with the following requirements: private data members string...

    in c++ Define and implement the class Employee with the following requirements: private data members string type name a. b. double type hourlyRate 2. public member functions a. default constructor that sets the data member name to blank"and hourlyRate to zero b. A constructor with parameters to initialize the private data members c. Set and get methods for all private data members d. A constant method weeklyPay() that receives a parameter representing the number of hours the employee worked per...

  • PYTHON PROGRAM by using functions & dictionary or set. - must create a variable to hold...

    PYTHON PROGRAM by using functions & dictionary or set. - must create a variable to hold a dictionary or sets - must define a function that accepts dictionaries or sets as an argument A dictionary maps a set of objects (keys) to another set of objects (values). A Python dictionary is a mapping of unique keys to values. For e.g.: a dictionary defined as: released = { "iphone" : 2007, "iphone 3G": 2008, "iphone 3GS": 2009, "iphone 4" : 2010,...

  • For all problems you must: Write a Python (.py) program Test, debug, and execute the Python...

    For all problems you must: Write a Python (.py) program Test, debug, and execute the Python program Submit a copy of your commented source code on-line (11 pts.) Create a Person class that contains the following members: name, email, and phone_number Provide a constuctor that initializes all three members with data passed to the constructor. Add a __str__ method that returns a string printing the data members. Provide methods that allows you to get and set all three data members....

  • Python: Design a Ship class that has the following members: A member variable for the name...

    Python: Design a Ship class that has the following members: A member variable for the name of the ship. A member variable for the year that the ship was built. An init method and appropriate accessors and mutators. A print function that displays the ship’s name and the year it was built. Design a CruiseShip class that is derived from the Ship class. The CruiseShip class should have the following members: A member variable for the maximum number of passengers....

  • eciare a class to represent sample data set of 150 elements called DataType. DataType has two member vari member functions and include the functions to generate a sample set of random numbers be...

    eciare a class to represent sample data set of 150 elements called DataType. DataType has two member vari member functions and include the functions to generate a sample set of random numbers between 81 and 255, maximum value, and the range ables- an integer array and its size. Declare the basic calculate the mean, median, the minimum value, the eciare a class to represent sample data set of 150 elements called DataType. DataType has two member vari member functions and...

  • write the following functions in Picat, Haskell, or python using recursion. 1. member(x, lst): this function...

    write the following functions in Picat, Haskell, or python using recursion. 1. member(x, lst): this function checks to see if x occurs in lst. 2. sorted_list( lst): this function checks if lst is sorted in ascending order 3. Cartesian(xs, ys): this function takes two sets represented as lists, xs and us,, and returns the Cartesian product of the set, I.e a set of all possible pairs (x, y), where x is an element of xs, and y is an element...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT