Skip to content

Water - Jessica C#33

Open
jwinchan wants to merge 5 commits intoAda-C14:masterfrom
jwinchan:master
Open

Water - Jessica C#33
jwinchan wants to merge 5 commits intoAda-C14:masterfrom
jwinchan:master

Conversation

@jwinchan
Copy link

Assignment Submission: Solar System

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
When does the initialize method run? What does it do? It runs at the beginning of each class to set default parameter values.
Why do you imagine we made our instance variables readable but not writable? We don't want the user to be able to change the variables within an instance.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? We would not be able to define summary method that we did within the class Planet
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? We would need to create a separate key for each of the planets, which is extra steps to the code.
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, because each class defines one type of object (i.e. planet or solar system)
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? 'Require' statements are written at the top of the relevant files. I only used 'require' statements in main.rb since it was the only file that called on other 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