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

Ports - Amy W #45

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

Ports - Amy W #45

wants to merge 9 commits into from

Conversation

amythetester
Copy link

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 a new object is created from the class. It establishes the instance variables for that class. For Solar System it is star name and planets array while for the Planet class there are many more.
Why do you imagine we made our instance variables readable but not writable? This is because we want to access the variables, but not change the values.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? I would use the planet name for the key and the information about the planet in a hash as the value. This can get complicated depending on how many values need to be tracked for the planet.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? The SolarSystem would be the key and the value would be an array of planets. If I were not able to do an array at all, I would use planet# as the key and the name as the value in the hash.
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? I believe so. The SolarSystem class focuses on the star the planets are orbiting and knowing which planets are part of the SolarSystem. The Planet class is responsible for establishing features and characterists about the planets.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? I did this from main and required solar-system and planet because those classes are independent and don't need to require each other.

@tildeee
Copy link

tildeee commented Mar 5, 2019

Solar System

Nice work on this, Amy!

The code looks great! Especially your Planet and SolarSystem class. Your main method looks good, too, but I definitely see opportunities for refactoring.

That being said, you did a good job with this project. Well done overall.

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