CMPUT175 Chapter Notes - Chapter 10: Ido Language, Init

99 views6 pages

Document Summary

10. 3: designing and implementing a planet class class classname: def method1(): def method2(): all classes should first provide a constructor method, which is the way data objects are created. 3 def __init__(self , iname , irad , im , itemp ): 10. 5: designing and implementing a solar system: a complete solarsystem class, with a sun at the center and an empty collection of planets: 11 print(aplanet: creating and showing a solar system with four planets: 10. 6: animating the solar system: the solarsystem class with a hidden turtle: 2 def __init__(self , width , height ): 22 self. ssscreen. exitonclick (: the sun class with visualization: 2 def __init__(self , iname , irad , im , itemp ): 20 return self. y: the planet class with visualization: 2 def __init__(self , iname , irad , im , idist , ic): 27 return self. y: creating and showing a sun and four planets: >>> m = planet(mercury, 19. 5, 1000, . 25, blue)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions