
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

Transcribed Image Text:OOP Homework Inheritance (PYTHON)
1. Given two classes as described in Customer.py (attached) Revise the class using
inheritance to simplify the codes and to remove repetition of codes. Package-delivery
services, such as FedEx®, DHL® and UPS®, offer a umber of different shipping
options, each with specific costs associated. Create an inheritance hierarchy to
represent various types of packages.
Output:
Sender:
Ellen
Abberton WR10
Recipient:
Dane
Abbey Dore, HR2
Cost: £40e
Sender:
Mike
Agglethorpe DL8
Recipient:
Andy
Acton Bridge, CW8
Cost: £68e
Sender:
Andy
Acton Bridge CW8
Recipient:
Luke
Abingworth, RH20
Cost: £61e
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 2 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
- Please help me with this using java. Please use comments explaining each line of code. Please complete both part A and Barrow_forwardNumber 3arrow_forwardJava Inheritance problem Hi everyone, I've trouble understanding and efficiently finishing this assignment. In this assignment we are required to populate 20*15 scores for 20 students. I can only do it manually, can anyone help to tell me a much better way to solve it?arrow_forward
- Overview Construct a hierarchy of classes representing savings and checking accounts as well as a means to ‘filter’ account objects. Account Classes Your solution will consist of 4 account classes as described below. It is your responsibility to define the exact relationship among those classes and translate that relationship into source code structure. There is a correct structure; the skeleton must be modified to reflect the correct relationships. Account – represents a general account with basic operations such as deposit, withdraw, etc. Savings – represents a savings account that must maintain a minimum balance. Checking – represents a checking account that has no minimum balance (this means a zero balance). CappedChecking – represents a checking account that disallows a balance above a particular maximum value. Linking Accounts A bank or credit typically allows a user the ability to link accounts together. That is, I might wish to link my checking account with my savings…arrow_forwardIn UML class diagram given below, which attributes and behaviors of the Animal class would be inherited by the Dog class? Animal int # numberOfLegs: # numberOfTails: int # name: String + walk() + run() + eat() + playFetch() Dog A None of the attributes and behaviors are inherited B numberOfLegs, numberOfTails, walk(), run(), eat() (c) All attributes and behaviors of Animal are inherited playFetch()arrow_forwardCreate a UML Class Model based on the requirements . Your Class Model is to include: All classes Attributes and Attribute Types Associations Multiplicity Primary and Foreign keys Any Inheritance, Composition or Aggregation. Building Maintenance system. A rental property management company wants to develop a ‘Building Maintenance System.’ This system will be used by the company to manage maintenance requests from tenants in the several rental buildings that it manages in the city. Each building has a maintenance manager. The maintenance manager is responsible for creating accounts in the system for each tenant in their building. A tenant can rent multiple apartments within the same building. Tenants can submit maintenance requests using this system. Each maintenance request will have a request ID, category, and description. The maintenance manager manages a maintenance crew in their building. Maintenance crew members can be members of more than one maintenance team. Maintenance crew…arrow_forward
- Question 30 Which of the following description is TRUE? Inheritance allows us to define a class based on another class. Child classes receive all the features from the parent class but can NOT have their own additional features. Abstraction means that a method in a parent class can have a number of different implementations in child classes. An interface is a completely abstract class, which contains abstract properties, methods, and variables. The private access modifier makes members accessible only from within the class and hides them from the outside.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:Single inheritance means one class inheriting from one super classes more classes inheriting from one super class more classes inheriting from more super classes None of the abovearrow_forward
- Create the inheritance hierarchy displayed below. The Student class has name(string) as a private data member. The Undergraduate Student class has private data member rank(string) that can be either freshman, sophmore, junior or senior. The GraduateStudent has private data member project (string). Include constrcutor and get/set functions as well as a print function in all classes. Test the class hierarchy by demonstrating polymorphic behiavior by decalring a vector containing Student, UndergraduatStudent, and GraduateStudent. Process the vector elements by calling the print function on each object in the array. Student Undergraduate Student Graduate Studentarrow_forwardHelp with c++. Paste indented codearrow_forwardInheritance Hierarchy Given the following classes, arrange them into an appropriate inheritance hierarchy (by just adding a Java keyword and a class name, you do NOT need to add fields and methods). Save each class in it's own file (e.g., the BakeryItem class in BakeryItem.java). Submit all of the files. public class BakeryItem{ /* fields and methods omited for brevity */ } public class FoodItem{ /* fields and methods omited for brevity */ } public class FrenchBreadItem{ /* fields and methods omited for brevity */ } public class FruitItem{ /* fields and methods omited for brevity */ } public class ProduceItem{ /* fields and methods omited for brevity */ } *Note: I have recieved information from my teacher stating, " For the exercise, your files should start with “public class ClassName”. If that class is inheriting from another class, then, it should have “extends ParentClass”. Furthermore, the file should be in ClassName.java."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