Skip to content

Conversation

@sairagula
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? To define my instance variables
Describe an instance variable you used and what you used it for. I used @planets instance variable to store an array of planets created from my Planet class. Inside my Solarsystem class I used it in several methods
Describe what the difference would be if your SolarSystem used an Array vs a Hash. I used array to store my planet objects. I had a method in my Planet class to print out in a given way, if I used hash I couldn't be able to use it
Do you feel like you used consistent indentation throughout your code? Mostly yes, sometimes I used auto indentation

@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 - initialize can also call other methods.
Submission meets project expectations.
Additional Feedback
Naming Conventions class names should be CamelCase, with each word capitalized. instead of Solarsystem, it should be SolarSystem
helper method Instead of writing attr_reader for each attribute, you can do it all on one line, by separating each attribute with a comma, like so attr_reader :name, :mass, :diameter, :year_length, :distance_from_sun
list_planets method When needing a counter number and working with an entire array, using the .each_with_index method on the array will iterate through the array and give you the index number of the element.
distance_from_other_planets method Its doing something. As long as you have two planet instances, you can call it like this: puts p1.distance_from_other_planet(p2). I commented out the user interface portion and ran this.

@sairagula
Copy link
Author

sairagula commented Aug 18, 2017 via email

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