
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
Please create your own code and some commentary for a better understanding. Thank you

Transcribed Image Text:Python
create a python class called Person that defines two attributes name and age and the following methods:
__init__ initializes the attributes name and age, both mandatory
the methods set_name and set_age to affect a value to attributes name and age respectively
the methods get_name and get_age to return the value for name and age respectively
define the method age_diff that displays the difference of age between two objects of type Person
Create a class Student that inherits the parent class Person. It redefines the method _init__ by reusing
the _init_ method of Person, and also by initializing the attribute friends, which will always be initialized
to an empty list.
Define the method add_friend to add an element of type Student to the friend list. This method add an
element to the list friend if and only if the element is not already in the list.
Define the method __str__ to display the object of type Student as in the example.
Define the method get_friends of the class Student. This method displays the elements of the list friend.
The method get_friends follows the display as in the following example:

Transcribed Image Text:example:
>>> el = Etudiant('marie', 20)
%3D
>>> e2 = Etudiant('john', 17)
>>> e3 = Etudiant('jose', 18)
>>> print(e1)
Student:marie:20
>>> print(e2)
Student:john:17
>>> print(e3)
Student:jose:18
>>> el.add_friend(e2)
>>> el.add_friend(e3)
>>> e1.get_friends ()
Here are the friends of Student:marie:20
Student:john:17 - Student:jose:18 –
>>> el.add_friend(e3)
>>> el.get_friends()
Here are the friends of Student:marie:20
Student:john:17 - Student:jose:18 –
>>> e1.age_diff(e2)
3 years difference
>>> e3.age_diff(e1)
2 years difference
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 3 steps with 3 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
- Here are what to display on your Pokémon's show page: The pokemon's name The image of the pokemon An unordered list of the Pokemon's types (eg. water, poison, etc). The pokemon's stats for HP, ATTACK, and DEFENSE. Routes Your app should use RESTful routes: Index GET /pokemon Show GET /pokemon/:id New GET /pokemon/new Edit GET /pokemon/:id/edit Create POST /pokemon Update PUT /pokemon/:id Destroy DELETE /pokemon/:id This is the module.js file module.exports = [ { id: "001", name: "Bulbasaur", img: "http://img.pokemondb.net/artwork/bulbasaur.jpg", type: [ "Grass", "Poison" ], stats: { hp: "45", attack: "49", defense: "49", spattack: "65", spdefense: "65", speed: "45" }, moves: { level: [{ learnedat: "", name: "tackle", gen: "V" }, { learnedat: "3", name: "growl", gen: "V" }, { learnedat: "7", name: "leech seed", gen: "V" }, {…arrow_forwardPlease help me with this 1. Create a t squared tractal 2. create a viscek fractal (comment the code)arrow_forwardFront End Text, Font, and Color Details Colors: · App Background: #222233 (This can be set in the ContextPage tag at the top) · Background color for the options container: #444455 · Background color for the “Receipt” header row: #555566 · Background color for the “Total” row: #555566 · Background color for the receipt body: #444455 · Text color for the Total Amount on Receipt screen: #FFAAAA · App Title Color (“Lenny’s Car Wash): CadetBlue · Button Background Color: #779977 · Button Text Color: White · Error Message Text Color: #FF7777 Font Sizes: · “Lenny’s Car Wash” title: 50 · Header Text for Selection Screen: 25 · “Receipt” text for Receipt Screen: 25 · Body of Receipt: 20 · Total Amount Text: 22 · Error Message Text: 20 Attributes for Specific Text: 2. Lenny’s Car Wash Title: Bold, Italics 3. Buttons: Boldarrow_forward
- Could you please add detail comments to explain what is happening in the code for each row?arrow_forwardUsing the Report Wizard, you can select the for the report. O A. font colors 8. layout C. theme D. font styles Save Answerarrow_forwardExcel date fields have the date to the right of the decimal point, and time to the left of the decimal point. True Falsearrow_forward
- What TextAlign values are available?arrow_forwardWith the frmTutorSearch form still open in Design View, use the Title button to add a title to the form. Replace the default title text with Tutor Information Form. (Hint: Do not include the period.) Save and close the frmTutorSearcharrow_forwardYou need to show detail work on how you get the answer. Dont use answers from other websites please! Please type your answer not picture Convert 10111.1101 to decimal View keyboard shortcutsarrow_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