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

Queues - Ting Wong - Solar System.rb #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Queues - Ting Wong - Solar System.rb #26

wants to merge 1 commit into from

Conversation

tingwong
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 in my class created a hash with attributes about the planet.
Describe an instance variable you used and what you used it for. I used an instance variable for @distance_from_the_sun, I later called it to calculate the distance between 2 planets.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. If 'SolarSystem' was an array, I would have a list of planets within the array, but wouldn't be able to easily call upon individual planet objects by their attributes (name, diameter, etc.). If I used a hash, I would be able to use the key-value pair to manipulate the data and call on planet objects by their key.
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 & a meaningful message. Well Done

In response to comprehension questions, the initialize method doesn't create the hash, but rather takes in a hash as an argument to set some attributes of the class.

At first I didn't know what the planet_object method was meant to do, just by looking at it's name. A good rule for naming methods is that I should have a good idea of the action that being performed by that method. For example, the name find_planet could have given this method more context.

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.

3 participants