Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Create a class Mammal and another class WingedAnimal. Make a class Bat that is derived from both the classes as bat is a mammal as well as a winged animal.
Make constructor of each class and test your classes by making an object of Bat in main function.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a code using abstract data types, classes, and inheritance methods as in the example below. Do not use the car class exemplified, but think of any similar use of such a class and adapt it to your idea. Make sure to follow all the requirements set below: Creating the Car Class Motorvehicles Solutions, Inc. is a business that sells cars and leasing services. You are a programmer in the company's IT department, and your team is designing a program to manage all of the cars that are in the inventory. You have been asked to design a class that represents a car. The data that should be kept as attributes in the class are as follows: The name of the car's manufacturer will be assigned to the __manufact attribute. The car's model number will be assigned to the __model attribute The car's retail price will be assigned to the __retail_price attribute The car's leasing price will be assigned to the __leasing_price attribute The class will also have the following methods: An __init__…arrow_forwardWrite the constructor method for class Circle which is a subclass of Shape class. Class Shape has one attribute (color) and one constructor (with one parameter). Class circle has attribute for radius.arrow_forwardIf you are designing an application for a car dealership, you will create a Vehicle parent class and then extend the class into Car, Truck, SUV child classes. The Vehicle class will have the general attributes and behaviors. Then, you only need to code the specific differences in the child classes. Give us an example of objects that might have similar attributes and behaviors but enough differences to warrant an inheritance relationship. Then, explain the relationship and teach your classmates about inheritance.arrow_forward
- Hi, I am making a elevator simulation and I need help in making the passenger classes using polymorphism. Any help is appreciated. There are 4 types of passengers in the system:Standard: This is the most common type of passenger and has a request percentage of 70%. Standard passengers have no special requirements.VIP: This type of passenger has a request percentage of 10%. VIP passengers are given priority and are more likely to be picked up by express elevators.Freight: This type of passenger has a request percentage of 15%. Freight passengers have large items that need to be transported and are more likely to be picked up by freight elevators.Glass: This type of passenger has a request percentage of 5%. Glass passengers have fragile items that need to be transported and are more likely to be picked up by glass elevators. This is what I have so far // Passenger abstract classpublic abstract class Passenger { protected String type; protected int requestPercentage; public…arrow_forwardConsider a class "Fan" with two integer data members, "state" (0/1 i.e. on or off) and "speed". 1. Write a parameterized Constructor for this class. 2. Write a member function "changeState( )" which behaves similar to pressing a button i.e. it should change the state of the fan. If it is off (0), calling the function should turn it on (1) and vice versa.. Multi Line Text.arrow_forwardUse 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…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education