Skip to content

Conversation

@habypsow
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? The initialize method is used to define parameters, so that we can run arguments through this method.
Describe an instance variable you used and what you used it for. I used many instance variables, for example, I used a @diameter instance variable, so that I was able to call this variable outside of the method, since, were I not to use an instance variable, I would get an error due to scope.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. I used an array in my solar system, to store the planet information. Using a hash would have allowed me to set key-value pairs, so that I would have a hash within a hash for each planet to store planet, and then the planet attributes. It might have made collecting key-value pairs in the initialize method easier to access.
Do you feel like you used consistent indentation throughout your code? yes :)

@kariabancroft
Copy link

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. Yes. You probably do not need an attr_accessor for every single property though. Think about: Do I need to access this instance variable outside of my class?
Used an Array to store a list of planets in the SolarSystem class. Yes - I would really like to see you implement the commented-out print_system method in your SolarSystem class. See me if you'd like some assistance.
Readable code with consistent indentation. Yes - one important thing is when you separate a list of parameters/arguments, you should add a space after each comma (line #5, 23 - 25, for ex)
Created a pull request with your name & a meaningful message. Yes - With Q#1, you're almost there. The initialize is used to instantiate the object first and foremost. The secondary purpose is to assign instance variables.

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