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

Leaves - Katie (All Waves Complete) #51

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

Conversation

KKennedyCodes
Copy link

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
When does the initialize method run? What does it do? The initialize method makes the data accessible to the methods in the class.
Why do you imagine we made our instance variables readable but not writable? We do not want the user to be able to change the values or information.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? It would be more difficult to access the information. I would have to iterate through the information to find what I need. By making each planet an instance of a class, I can easily call upon that instance to find specific information about that planet.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? If I would have used a Hash to store planet information, I would have to use a key to find planet info. It would add another step to getting the information needed.
There is a software design principle called the SRP. 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? Yes my program follows the SRP method. The planets class assigns planet information and the solar system class adds the planets to the system.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? My main.rb file was the only file that needed require statements. The main needed the statements in order to access the classes and methods in the associated files.

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.

1 participant