Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theresa's Solar System #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

TheresaManney
Copy link

@TheresaManney TheresaManney commented Feb 15, 2017

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 sets the default values (instance variables) of the object. In my Planets class, my instance variables call on the keys that can be found in a hashes within the main. In my SolarSystem class, I created an instance variable equal to an empty array so that planets can be pushed into it using a separate method within the SolarSystem class.
Describe an instance variable you used and what you used it for. I used a @planets instance variable within my SolarSystem class. This instance variable started off as an empty array, then had the utility to be filled by using a planet_add method that I created to push and store planets and their info.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. If my SolarSystem class were to take in arrays instead of hashes then when selecting the name in the array containing the different planets and their information, instead of calling [:name] I would call the name by selecting whatever index the name was in the array. This would also change the way my Planet class initialize method, again, instead of selecting the keys associated with the value I wanted to print, I would print the specific index within the array.
Do you feel like you used consistent indentation throughout your code? Yes, I also double checked by using selecting all and then using the option/command/l quick key to auto align all of my code.

@CheezItMan
Copy link

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. Done, nice work using
Used an Array to store a list of planets in the SolarSystem class. Done, for SolarSystem why use a Hash as a parameter if you are only using the :name key. Generally we use Hashes when we're sending multiple values to the method.
Readable code with consistent indentation. Check
Created a pull request with your name & a meaningful message. Well done

Summary

Nicely done, you covered all the prerequisites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants