Skip to content

Conversation

@mgraonic
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? Create an instance of the solar system class (and planet class). Invoked by Class.new
Describe an instance variable you used and what you used it for. I used @planets to house the array of planets.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. The array is an ordered list of planet objects and a hash would not be ordered, so adding a planet to a hash would break my case statements since they are hard coded. Had I used a hash, I could have assigned a key to each planet and that might make finding it easier.
Do you feel like you used consistent formatting throughout your code? I think so.

@tildeee
Copy link

tildeee commented Feb 14, 2018

Solar System

What We're Looking For

Feature Feedback
Baseline
Readable code with consistent indentation. x
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

You did a good job of making two classes SolarSystem and Planet. These classes manage their own states and behaviors and you defined a lot of good custom states and methods.

Your code relies a lot on hard-coded information.

For example, when you prompt the user "Select a planet to view more information," you set planet_selection to user input, and then make a case statement for when planet_selection is 1 it does mercury.summary, when planet_selection is 2, it does venus.summary, etc.

It would be ideal if we could say, "hey, there are a bunch of planets that exist in our SolarSystem instance called milky. I wish I could say for every planet that milky has, we will then call .summary on whatever that planet is even if we add an infinite number of planets"
I would definitely recommend spending a little bit of time thinking about how to accomplish that! :)

Good 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