You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod in your class?SolarSystemused anArrayvs aHash.