SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
a. Create an arbitrary class without any attributes and methods. b. Write a class named
PLANETS, which should have the following data attributes: - name (for the name of the planet) -
diameter (for the diameter of the planet) - distance (for the distance from sun of the planet) -
length (for the length of year of the planet) c. Inside the class PLANET, define a method called
number_of_moons () which return a message including the planet name and number of moons in
that planet with the default value 0 . (Hint: number of moons is the method input). d. Create a
child class Earth that will inherit all of the variables and methods of the PLANET class. e. Create
an object from child class Earth that will inherit all of the variables and methods of the parent
Vehicle class and display it. Expected Output: Planet Name: Venus Planet Diameter (miles):
7520 Planet distance (million miles) : 67 Planet length of year (days): 225

Más contenido relacionado

Más de amazefootwear

A. Discuss which corporate diversification strategy (reference sectio.pdf
 A. Discuss which corporate diversification strategy (reference sectio.pdf A. Discuss which corporate diversification strategy (reference sectio.pdf
A. Discuss which corporate diversification strategy (reference sectio.pdf
amazefootwear
 

Más de amazefootwear (9)

A. To calculate and display the number of records in Random Access Fi.pdf
 A. To calculate and display the number of records in Random Access Fi.pdf A. To calculate and display the number of records in Random Access Fi.pdf
A. To calculate and display the number of records in Random Access Fi.pdf
 
A. The map below shows the boundaries between the major plates. Write.pdf
 A. The map below shows the boundaries between the major plates. Write.pdf A. The map below shows the boundaries between the major plates. Write.pdf
A. The map below shows the boundaries between the major plates. Write.pdf
 
a. The function call for a function named dog that has no parame.pdf
 a. The  function call for a function named  dog that has  no parame.pdf a. The  function call for a function named  dog that has  no parame.pdf
a. The function call for a function named dog that has no parame.pdf
 
a. Simple Columnar b. Stratified Cuboidal c. Pseudostratified d. Tran.pdf
 a. Simple Columnar b. Stratified Cuboidal c. Pseudostratified d. Tran.pdf a. Simple Columnar b. Stratified Cuboidal c. Pseudostratified d. Tran.pdf
a. Simple Columnar b. Stratified Cuboidal c. Pseudostratified d. Tran.pdf
 
A. Mantenga el tama�o del equipo peque�o. B. Financie al .pdf
 A. Mantenga el tama�o del equipo peque�o. B. Financie al .pdf A. Mantenga el tama�o del equipo peque�o. B. Financie al .pdf
A. Mantenga el tama�o del equipo peque�o. B. Financie al .pdf
 
a. Oligodendrocytes Produces myelin around a singular b. Astrocytes.pdf
 a. Oligodendrocytes Produces myelin around a singular b. Astrocytes.pdf a. Oligodendrocytes Produces myelin around a singular b. Astrocytes.pdf
a. Oligodendrocytes Produces myelin around a singular b. Astrocytes.pdf
 
a. Ellie is 15 and claimed as a dependent by her parents. She has $1,.pdf
 a. Ellie is 15 and claimed as a dependent by her parents. She has $1,.pdf a. Ellie is 15 and claimed as a dependent by her parents. She has $1,.pdf
a. Ellie is 15 and claimed as a dependent by her parents. She has $1,.pdf
 
A. Discuss which corporate diversification strategy (reference sectio.pdf
 A. Discuss which corporate diversification strategy (reference sectio.pdf A. Discuss which corporate diversification strategy (reference sectio.pdf
A. Discuss which corporate diversification strategy (reference sectio.pdf
 
A. Definici�n clara del problema que se est� estudiando. B..pdf
 A. Definici�n clara del problema que se est� estudiando. B..pdf A. Definici�n clara del problema que se est� estudiando. B..pdf
A. Definici�n clara del problema que se est� estudiando. B..pdf
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

a. Create an arbitrary class without any attributes and methods. b. W.pdf

  • 1. a. Create an arbitrary class without any attributes and methods. b. Write a class named PLANETS, which should have the following data attributes: - name (for the name of the planet) - diameter (for the diameter of the planet) - distance (for the distance from sun of the planet) - length (for the length of year of the planet) c. Inside the class PLANET, define a method called number_of_moons () which return a message including the planet name and number of moons in that planet with the default value 0 . (Hint: number of moons is the method input). d. Create a child class Earth that will inherit all of the variables and methods of the PLANET class. e. Create an object from child class Earth that will inherit all of the variables and methods of the parent Vehicle class and display it. Expected Output: Planet Name: Venus Planet Diameter (miles): 7520 Planet distance (million miles) : 67 Planet length of year (days): 225