Skip to content

Conversation

@kaseea
Copy link

@kaseea kaseea commented Feb 27, 2019

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
When does the initialize method run? What does it do? It runs when you create a new object, it fills your instance variable with default/provided information.
Why do you imagine we made our instance variables readable but not writable? The scope of the project was to organize a collection of planets in a solar system, and information on the planets. We need to access the information, but don't need to modify it
How would your program be different if each planet was stored as a Hash instead of an instance of a class? much messier! I wouldn't be as easy to add and retrieve behaviors, the structure would be weird and it'd be hard to access information, but making an instance variable organizes everything for you in a way thats easy to access
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? less organized, a hash wouldn't really be necessary since you only have to put a planet in it, so an array would be enough since planet is a class and holds all the info it needs, a hash would have to save more information (why need a key and value when you can just have planet?)
The Single Responsibility Principle (SRP) says that each class should be responsible for exactly one thing. Do your classes follow SRP? What responsibilities do they have? the solar system class collects/points to the planets, the planet class points to planet info.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? main required require statements, because that's where the file the program was running, and main needed to access info from the other files.

@CheezItMan
Copy link

Solar System

What We're Looking For

Feature Feedback
Overall Nice work, you hit all the learning goals for the project.

puts "what planet do you want more info on"
planet = gets.chomp
found_planet = solar_system.find_planet_by_name(planet)
puts found_planet.summary

Choose a reason for hiding this comment

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

You should do some sort of check to see if you could find the planet before calling .summary

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