Skip to content

Conversation

@tvojnar
Copy link

@tvojnar tvojnar commented Aug 16, 2017

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class? To initialize a new instance of the class with all of its instance variables
Describe an instance variable you used and what you used it for. I used an instance variable for the name of each planet in the solar system (@name). I used this instance variable within the methods in my SolarSystem class to do things like print the name of the planet in a string, or match user input to the name of a planet in the solar system
Describe what the difference would be if your SolarSystem used an Array vs a Hash. Assuming that is question is targeted at wave 1 .... If I had used an array it would have been more difficult to access the information I wanted to print out to the user about each planet.
Do you feel like you used consistent indentation throughout your code? Yes

@PilgrimMemoirs
Copy link

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. Well Done
Used an Array to store a list of planets in the SolarSystem class. Well Done
Readable code with consistent indentation. Well Done
Created a pull request with your name & the template questions answered. Well done - Some clarification: The instance variable @name is only accessible within the class it's defined, which is Planet. You were only able to use a specific planet's name by calling the name reader method on an instance, like so (assuming planet is a variable storing an instance of the Planet class): planet.name.
Overall Submission meets project expectations.
Additional Feedback
Object Types For Planet's age, age should be stored as either an integer or float so that you can easily perform math on it if needed (like to see what the difference in age is between two planets). Using a consistent measurement for age will allow you not to need to specify 'billions'.
Refactor Unnecessary Code After you have completed a new feature, like a method, go back and evaluate if there is anyway you can refactor the code to be more efficient or remove anything unnecessary. For SolarSystem's info_for_one_planet method, if you're only working with one planet, there is no need to add strings together. Instead you should return the string that is returned from planet.planet_info directly. It also does not need to be inside of a string interpolation since it is already a string. You can also use the .each on @planets instead of the .each_with_index, since you never use the index.

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