Create an Animal class, with attributes name, age. Create classes Dog2, Cat2, Fish2, Bird2 to inherited from Animal class. Create PetOwner2 class to test the inheritance and polymorphism. please share a screen shot of the code.
Q: Which of the options presented would be a valid conclusion to infer from these premises? the gudgeon…
A: I given handwritten explanation in the below steps.
Q: Explain in fully what Intensive and Extensive reading are.
A: INTRO The two most important reading styles are known as Intensive and Extensive reading. Let's see…
Q: In programming, define synthetic sugar.
A: Syntactic sugar in programming: It is a term that is used for the changes made to the syntax of the…
Q: Demonstrate the importance of object-oriented analysis while developing an information system.
A: Introduction: Many businesses deal with huge amounts of data. Data is the collection of basic values…
Q: Consider the binary BCH code with length 127 and expected distance 6 using the binary field…
A: Introduction: The BCH codes, abbreviated for Bose–Chaudhuri–Hocquenghem codes, are cyclic…
Q: Which conditional jump instruction is equal to the JNA instruction?
A: JNA - Condition it tests before jump is if CF = 1 or ZF = 1 then jump. one more instruction which…
Q: What is a memory void, exactly? How is this possible, and how does the operating system deal with…
A: Overview: Memory chasmDivide all available memory into equal-sized divisions and assign each process…
Q: What is information blockage in the context of health IT?
A: Introduction: In general, information blocking is a practise by a certified health IT developer,…
Q: How would you characterize the development of a programming language?
A: Programming languages are documentation for expressing algorithms and data structures on a machine…
Q: What is cloud computing, exactly? What are the benefits and drawbacks of cloud computing?
A: CLOUD COMPUTING: The availability of various resources on the network is cloud computing. These…
Q: Make a list of five circumstances in which you might use a queue.
A: Introduction: A queue is a First-In-First-Out mechanism in which the item that was inserted first is…
Q: Computer science Short answer What, exactly, is a processor?
A: Introduction What, exactly, is a processor?
Q: Name the module that is made accessible to other modules by default.
A: Introduction: A module is a software component or component of a programme that consists of one or…
Q: Investigate social media blogging and cloud computing in further detail?
A: Social media are intelligent innovations and advanced channels that work with the creation and…
Q: What techniques may be used to make online and offline password guessing more difficult?
A: Please find the answer below :
Q: Is it possible to foresee what causes may result in scope creep when creating an information system?
A: Scope Creep: Scope creep occurs when a project's scope changes and the work begins to stretch, or…
Q: What is necessary for a virtual machine to run? (execute). What file type is utilized to import a…
A: Virtual Machine: A virtual machine (VM) is an operating system (OS) or application environment that…
Q: A decision table simplifies the process of connecting circumstances to actions. explain?
A: Intro - linking conditions with actions in decision table - decision table are made up of columns…
Q: Are you able to describe the three data structures?
A: Introduction: Data structure Data structure is a method of organising and storing data in computer…
Q: What are the four distinct feasibility categories? Which type is more concerned with total ownership…
A: Introduction: One of the processes in project development is feasibility research, which is an…
Q: What exactly is the meaning of website optimization?
A: INRODUCTION: Website optimization is enhancing your website's performance through tools,…
Q: What are the many types of interruptions in a microprocessor system?
A: Introduction: The Interrupt occurs when a process is being executed by the CPU and a user requests…
Q: What storage media would you recommend to a classmate for secure and flexible storage of the…
A: Common storage medium: Hard Disk Drive Hard Disk Drive: It is an magnetic storage device. storage…
Q: What exactly is a relocatable object file?
A: INTRODUCTION: OBJECT FILE: An object file is a computer file that contains object code, which is the…
Q: Consider the challenges and barriers that will occur as you create the framework, and then assess…
A: Intro When building the design of an information system, there are certain challenges to tackle,…
Q: Describe the changes that have occurred throughout time. Collaboration across several domains is…
A: Human computer science: Human-Computer Interaction is the branch of computer science that studies…
Q: hiding techniq
A: Among different data hiding techniques, the reversible ones for the JPEG space are still a couple…
Q: You pick three tickets at random. What it the probability that all of them have the number 6?
A: No of ways to choose three tickets from 45 tickets can be derived as 453
Q: Given the collection of Big Oh and Big Omega assertions below, which of the Following Big Theta…
A:
Q: At least three frequent defects or disadvantages of DHCP implementation on a local area network…
A: Introduction: There are three major drawbacks:
Q: What functions are used to create Authenticator? Give a detailed description.
A: Actually, given question regarding functions to produce Authenticator.
Q: Thus, how is it distinct from what we often refer to as the internet of things? What are some…
A: Answer to the given question: The internet of things, or IoT, is a system of interrelated processing…
Q: When it comes to system analysis and design, what are the benefits of object-oriented analysis?
A: Answer to the given question: Object-oriented analysis and design (OOAD) is a mechanical way to deal…
Q: quantum co
A: Introduction: Computing is the application of computer technology to accomplish a certain aim.…
Q: What factors should you take into account while selecting a database management system?
A: Introduction: A database management system (DBMS) is a system for storing and retrieving data.
Q: Write the SQL statements to do the following: Create a trigger named trg_updatecustbalance2 to…
A: The question is to write the SQL query for the given problem.
Q: he following is the definition of a ForkJoinTask: Where do RecursiveAction and RecursiveTask differ,…
A: Introduction: Assignments running within a ForkJoinPool have their own base class. A ForkJoinTask is…
Q: Do you think it's a good idea to use the cloud? Why?
A: Introduction: Cloud computing is a technology that provides internet servers, storage, databases,…
Q: Do you know the significance of Ada Lovelace in computing?
A: The Computing: Any goal-oriented activity that necessitates, benefits from, or generates computer…
Q: Suppose you are contacted by a software developer to create a hospital patient management system.…
A: GIVEN:
Q: Which technique of acquiring application software is the most efficient? With your answer, provide…
A: Introduction: The operating system of your computer serves as the foundation for all your activities…
Q: How can you tell if a model meets the requirements for proportionality and additivity?
A: Introduction An presumption is that a simplifying condition is taken into account in the research…
Q: Comparing and contrasting the following modelling and simulation techniques: a. Agent-Based…
A: Introduction: a. Agent-Based Simulation: an agent based simulation model is a set of interfacing…
Q: Describe how technology has impacted data security and ethics in data analytics (storage,…
A: Introduction: The impact of technology on data security and data analytics ethics.
Q: What are the differences between decision structures and sequence structures?
A: Introduction: A decision structure is designed to allow for conditional execution. It is intended to…
Q: What are the main differences between Computer Science and Computer Engineering?
A: Introduction: Computer engineering is a branch of electrical engineering that brings together…
Q: What are daemon processes, and why are they important? As an example, provide four instances.
A: Introduction Processes with distinct process identifiers are formed throughout the execution of a…
Q: Given the following statement: int v = rand() % 26 + 25; What is the range of v? O a. [0, 26] O b.…
A: The function rand() generates the random number. Here we have divided the random number by 26 and…
Q: What is the distinction between react native and react JS? programming
A: React webapps are actually the combination of different components which are run on the basis of how…
Q: Computer science What was the first functional language?
A: Introduction: Functional languages are essentially languages in which procedures are carried out…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create an Animal class, with attributes name, age. Create classes Dog2, Cat2, Fish2, Bird2 to inherited from Animal class. Create PetOwner2 class to test the inheritance and polymorphism.
please share a screen shot of the code.
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 7 images
- Create a class Animal and Add a protected data member named id of integer type. Add get/set methods for id data member in Animal class with public access. Also provide default constructor this should initialize id to 0. Also provide parameterized constructor and toString method. Add an abstract method tellAboutSelf method to Animal class with public access Add another abstract method speak method to Animal class. Reptile, Bird, Mammal Next create the three child classes which extends form Animal class. Add a default constructor to each of the above created class. The constructor should initialize the id data member id, Reptile, Bird and Mammal, to 1, 2 and 3 respectively also it display a message “(class Name)’s default constructor”. E.g. for Bird it says “Bird’s default constructor”. Add a parameterized constructor to each of the above created class. The constructor should initialize the id data member, Reptile, Bird and Mammal, to the specified id passed to the constructor also it…T/F1. Interface classes cannot be extended but classes that implement interfaces can be extended.Person and Customer Classes Write a class named (Person) with data attributes for a person’s name, address, and telephone number. Provide accessors/getters and mutators/setters for each attribute. Write a displayPerson() to print out the attributes of the Person. Next, write a class named (Customer) 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. Provide accessors/getters and mutators/setters for each attribute. Write a display customer() to print out the attributes of the Customer. Demonstrate an instance of the (Customer) class in a simple program.
- Write a shoe class with the following attributes: color (e.g., "blue", "green", "orange") displayName (e.g., "nikes, adidas", "puma") price (e.g., 100, 200,60) Include only one constructor. It should have parameters for each of the attributes and set their values. Additionally, include getters and setters for each of the attributes. Add a driver, name it Purchases, and create 2 objects. Finally, print out some information about both objects (i.e., print the information from some or all of the getters). For example, if you created a shoe object whose color was blue, whose display name was shoes , for a price of 230, you could use the getters to print something like this:These work trousers are blue and cost $230Scenario:You are hired by a game development company. Your task is to create an RPG hack & slashconsole game. The game will have a movement system that will be based on the x, y, zcoordinate system. You will need to start with creating 3 classes.1. A class that represents a player2. A class that represents an enemy3. An abstract class that contains the movement logic.Step 1:Start by creating the superclass which defines the movement system for both enemy andplayer. The movement system is based on the Coordinate system. Imagine an x, y, z plane,the y coordinate is used to move forward and backward in the virtual plane, x to go left andright, z to go up and down.For example, A player with coordinates x, y, z with values -5, 10, 0 represents a player -5units to the left, 10 units forward, and 0 z units mean on the ground. (0, 0, 0) are the baseunits which means the player or enemy is at the start of the level.Step 2:Create a class to represent the player which is derived from the…Assignment - LocationsFor this assignment, we will be creating our location class and then a few locations to subclass from it. Most of these classes will be rather short so you can put them all in locations.py if you would likeCreate the Location classCreate the Town classCreate the Palace and Lumbermill classes Location ClassThe Location class establishes the basic properties of a location: manager - holds the character that manages the locationforeColor - holds the fore color of the locationbackColor - holds the back color of the locationEnter() - default method for entering a location. By default, the manager should greet you and all text displayed should use the foreColor and backColor of the location.Exit() - default method for leaving a location. By default, the manager should say bye to you and all text displayed should use the foreColor and backColor of the location.Upkeep() - default method that is called when time is advanced Town ClassThe Town class will inherit from the…
- T/F1. Interface classes cannot be expanded, but implementation classes may.Class: Square Create a class called "Square", which is inherited from“TwoDimensionShape” class. The "Square" class is used to calculate theArea and the Perimeter of square shapes when their side-length is given, or in contrast,finding the side-length of the square when the Area or the Perimeter of the square is given.The specifications of this class are below. Data Members (Attributes): All are private. sideLength: the sidelight (L) of the square. Methods/Operations/Getters/Setters: Default Constructor: when creating an object this constructor must set the side-length of the square by calling the method setSideLength(). Also, this constructor willcall the findArea() and the findPerimeter() in addition to summaryPrint() to calculateand print all needed information. User-Defined Constructor: when creating an object this constructor shouldfind the side-length of the square by calling the method findSquareSideLength()and pass the Area or the…- Simple factory is not considered a design pattern because it does not decouple the client from concrete classes Select one: True False 2- structural patterns provide guidance on the way in which classes interact to distribute responsibility Select one: True False 3- The Simple factory is used when you want to limit the instantiation of classes to one implementation Select one: True False 4- When a class A is composing a reference to another class B, then we say that class A has-a class B relationship Select one: True False
- Use the Animal class file given on the final exam module. Use Inheritance and Polymorphism concepts to create the following classes and functions. Create the following classes that derive from the Animal class. Monkey Kangaroo Create a derived class named Spider Monkey whose base class is Monkey. Create constructors for each class. Create destructors for each class. All classes will have the following private instance fields, including Animal legs that will initialize to 0 boolean swim that will initialize to false; All classes will have the following polymorphic methods, including Animal getLegs( ) – this returns the number of legs the animal has makeSount( ) – this outputs the type of sound the animal makes makeSound( ) method will be a virtual function in the Animal class Create an exception in the getLegs( ) method that makes sure the number of legs are valid (only allow positive number amount of legs) Create a main method to demonstrate the all functions including the…(1) Extend the ItemToPurchase class to contain a new attribute. item_description (string) - Set to "none" in default constructor Implement the following method for the ItemToPurchase class. print_item_description() - Prints item_description attribute for an ItemToPurchase object. Has an ItemToPurchase parameter. Ex. of print_item_description() output: Bottled Water: Deer Park, 12 oz. (2) Build the ShoppingCart class with the following data attributes and related methods. Note: Some can be method stubs (empty methods) initially, to be completed in later steps. Parameterized constructor which takes the customer name and date as parameters Attributes customer_name (string) - Initialized in default constructor to "none" current_date (string) - Initialized in default constructor to "January 1, 2016" cart_items (list) Methods add_item() Adds an item to cart_items list. Has parameter ItemToPurchase. Does not return anything. remove_item() Removes item from cart_items list.…Scenario:You are hired by a game development company. Your task is to create an RPG hack & slash console game. The game will have a movement system that will be based on the x, y, z coordinate system. You will need to start with creating 3 classes.1. A class that represents a player2. A class that represents an enemy3. An abstract class that contains the movement logic.Step 1:Start by creating the superclass which defines the movement system for both enemy and player. The movement system is based on the Coordinate system. Imagine an x, y, z plane, the y coordinate is used to move forward and backward in the virtual plane, x to go left and right, z to go up and down.For example, A player with coordinates x, y, z with values -5, 10, 0 represents a player -5 units to the left, 10 units forward, and 0 z units mean on the ground. (0, 0, 0) are the base units which means the player or enemy is at the start of the level.Step 2:Create a class to represent the player which is derived from…