Skip to content

Conversation

@mmlamkin
Copy link

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class? It created all the instance variables needed for each instance of the classes.
Describe an instance variable you used and what you used it for. An instance variable is an attribute of an instance of of class. It is applicable for all instances of a class and can be used between methods.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. Using a hash would simplified the initialize method for the planet class!
Do you feel like you used consistent formatting throughout your code? I think I used consistent formatting.

@tildeee
Copy link

tildeee commented Feb 14, 2018

Solar System

What We're Looking For

Feature Feedback
Baseline
Readable code with consistent indentation. Your loop do doesn't indent the contents, but that's not that big of a deal
Primary Requirements
Created Custom Solar System Class with initialize, add planet & list planets methods, without using puts. Instead of modifying the @planets array on Solar System, you add planets using the planet_list
Planet Class Created x
Created a collection of Planet objects as an instance variable in SolarSystem. x
Accessor methods created x
Method created to return the Planet's attributes and not use puts x
Created a user interface to interact with the SolarSystem including adding a planet and viewing a planet's details x
Additional Notes

wow what a very real encyclopedia!!!!!! earth has aliens, cooool!!!!!

Juust kiddingg.

Good job on this project!

It does everything we expected. You created SolarSystem and Planet and they managed their own state and behavior.

I'm adding a comment to the code about a suggestion I have about using your instance of SolarSystem Milky_Way's planets instead of planet_list

Overall, good work

user_planet_list << user_name
planet_list << user_choice
elsif user_planet_list.include?(user_choice)
planet_list.each do |planet|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if on this line and line 90 you used Milky_Way.planets instead of planet_list!

Better yet, maybe you can make an add_planet method on SolarSystem, so line 90 instead reads:

Milky_Way.add_planet( Planet.new("#{user_name}", "#{user_moon}", "#{user_year}", "#{user_climate}", "#{user_aliens}", "#{user_age}") )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants