-
Notifications
You must be signed in to change notification settings - Fork 43
Jessica Owens -- Carets #27
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
base: master
Are you sure you want to change the base?
Conversation
Misleading instructions, later clarified in class, that created a lot of confusion about Wave 1.
| end | ||
|
|
||
| def rel_age | ||
| return (SolarSystem::AGE - @earth_age.to_i) * Planet::EARTH_YEAR / @earth_days.to_f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small bug: input to @earth_days doesn't check if this is a number or not. If it's not a number, .to_f makes it 0, which divides by zero.
Solar SystemWhat We're Looking For
|
|
Great code. Good use of constants, which we haven't learned about yet! Overall good work. regarding your questions about organization with code: now that we've learned how to use |
| valid = true | ||
| puts this_system.planets[i].prettify | ||
| print "\nPick another planet " | ||
| selection = user_prompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small refactor: You might be able to move the line selection = user_prompt to the end of the until loop to reduce code repetition!
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod in your class?class Planethad@nameas an instance variable that allowed me to call up a name for each instance of Planet I had created when desired.SolarSystemused anArrayvs aHash.SolarSystemdid use an array... I am not sure I understand this question the way you intend :( I could hasve used a hash instead of a class, but then I would have had no class methods. I probably could have created general methods instead... I'm just not sure I even managed this assignment as intended, honestly.