Skip to content

Conversation

@kseastman
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? To take an argument and add it to the named instance variable(s) each time a new instance of the class is created. For the Planet class, the initialize argument was a hash with 8 instance variables, for the SolarSystem class, the initialize argument was an array of hashes.
Describe an instance variable you used and what you used it for. @planets was an instance variable for the SolarSystem class that acted as a container for all of the planet objects created by the planet class. I used it to call information about the planets, and to build a reference dictionary linking the planet name to its object instance.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. I would have to use different methods to locate individual planet instances.
Do you feel like you used consistent formatting throughout your code? yes, or the cmd + i bit we installed has some explaining to do.

@tildeee
Copy link

tildeee commented Feb 14, 2018

Solar System

What We're Looking For

Feature Feedback
Baseline
Readable code with consistent indentation. Actually, your code between lines 203-230 should be indented backwards by one tab :P Atom has some explaining to do.
Primary Requirements
Created Custom Solar System Class with initialize, add planet & list planets methods, without using puts. x
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

Great job with this project submission!

You did a good job creating the SolarSystem and Planet classes, which all manage their own state and behavior, and using the main program to interact with an instance of SolarSystem.

As a small note, your program doesn't handle invalid input in some cases. For example, if I say 'yes' to learning about a planet, then place in 'asdf,' the program will break. Handling these cases wasn't a requirement of the project, just something to think about.

What you did with link_planets in SolarSystem is very clever.

Great work, overall!

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