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 -Hyunji Kim - solar_system.rb #41

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

Conversation

ricecakemonster
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? For the program to recognize the variables. To let the program know the initial set up.
Describe an instance variable you used and what you used it for. name, distance from the Sun, radius, mass, moons, density, gravity and rate of solar rotation.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. Array: If the info you put in is missing one or more elements, the index will get screwd up and the array will hold the wrong info in the wrong place. Hash: Since it holds keys instead of index numbers, you can put info that's missing one or more elements. Hash will still hold the correct data.
Do you feel like you used consistent indentation throughout your code? yes

@droberts-sea
Copy link

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. Yes
Used an Array to store a list of planets in the SolarSystem class. Yes
Readable code with consistent indentation. Yes
Created a pull request with your name & a meaningful message. Yes

Excellent work on the optionals!

class Planet
attr_accessor :name, :distance_from_the_sun, :radius, :mass, :moons, :density, :gravity, :rate_solar_rotation

def initialize(planet_hash)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job re-working Planet#initialize to take a hash.


def find_planet(planet_name) #solar_system.find_planet(whatever).distance_from_the_sun
i = 0
@planets.length.times do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on this bit of logic. It might be a little more clean if you used an each loop - you wouldn't have to use the [i] everywhere.

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