Using Python.
Complete the following:
class Pet:
def __init__(self, name, breed):
self.name = name
self.breed = breed
def get_name(self):
return self.name
def get_breed(self):
return self.breed
def set_name(self, name):
self.name = name
def set_breed(self, breed):
self.breed = breed
dog = Pet("Otis", "Pug")
print("Name:", dog.get_name())
print("Breed:", dog.get_breed())

Using Python. Complete the following: Create a class called Pet that has two attributes: name and...
python code? 1. Create a class called Person that has 4 attributes, the name, the age, the weight and the height [5 points] 2. Write 3 methods for this class with the following specifications. a. A constructor for the class which initializes the attributes [2.5 points] b. Displays information about the Person (attributes) [2.5 points] c. Takes a parameter Xage and returns true if the age of the person is older than Xage, false otherwise [5 points] 3. Create another...
Write Python code to create a class called Dog which represents a dog. The Dog class should have properties of breed (i.e. what type of dog it is), name and weight. The class should also have a constructor that takes these parameters to initialise the dog object, and a method called bark that prints out the word 'Woof!' to the screen. After you have defined the Dog class, create a Dog object called goodDog with a breed of 'terrier', a...
Using your Dog class from earlier this week, complete the following: Create a new class called DogKennel with the following: Instance field(s) - array of Dogs + any others you may want Contructor - default (no parameters) - will make a DogKennel with no dogs in it Methods: public void addDog(Dog d) - which adds a dog to the array public int currentNumDogs() - returns number of dogs currently in kennel public double averageAge() - which returns the average age...
Using Python you will create a simple class pet which will contain: Type of pet (a string) Name of pet(a string) Age of pet (an int) Tricks (a list of tricks the pet can perform) Fleas of pet (an int) All of these data attributes except for the last one (fleas) will be unique to each object. The fleas will be common to all pets, as they like to travel. In your main part of your program, you will create...
Python Program: Design a class Write a class called Sport that has a single attribute teamSize. Write a parametrized constructor to initialize the object. Inherit this class into another class called Football, with attributes teamName and numChampionships. Write a parametrized constructor to initialize this object and a printStuff function. Then, create an object of Football and print the values. Sample Run: The values are: Team Size: 45 Team Name: Florida State Seminoles National Champions: 3 times
Create a Python file (book.py) that has a class named Book. Book class has four attributes, title (string), author(string), isbn(string), and year(int). Title - the name of the book. Author - the name of the persons who wrote the book. ISBN - is a unique 13 digit commercial book identifier. Year - the year the title was printed. Your class should have the following methods: (1) __init__(self, title, author, isbn, year): This method called when an object (book) is created...
Create a Python file (book.py) that has a class named Book. Book class has four attributes, title (string), author(string), isbn(string), and year(int). Title - the name of the book. Author - the name of the persons who wrote the book. ISBN - is a unique 13 digit commercial book identifier. Year - the year the title was printed. Your class should have the following methods: (1) __init__(self, title, author, isbn, year): This method called when an object (book) is created...
Chapter 5 Assignment Read directions: In JAVA design and implement a class called Dog that contains instance data that represents the dog's name and dog's age. Define the Dog constructor to accept and initialize instance data. Include getter and setter methods for the name and age. Include a method to compute and return the age of the dog in "person years" (seven times age of dog. Include a toString method that returns a one-time description of the dog (example below)....
Inheritance and Polymorphism (use Pet.java) You are given a class named Pet.java. Create two child classes named Cat.java and Dog.java. Cat.java should add attributes for color and breed. Dog.java should add attributes for breed and size (use String for small, medium, large). Add appropriate constructors, getter/setter methods and toString() methods. In a separate file named PetDriver.java, create a main. In the main, create an ArrayList of Pet. Add an instance of Cat and an instance of Dog to the ArrayList....
Exercise: (2) Create a class called Dog containing two Strings: name and says. In main(), create two dog objects with names “spot” (who says, “Ruff!”) and “scruffy” (who says, “Wurf!”). Then display their names and what they say. Be sure to use setter and getter methods to assign(set) and retrieve(get) values for both Strings name and says. Your Task: Create the program using Netbeans and easyUML (i.e: Open a project in NetBeans then create the classes, attributes, and methods in...