Skip to content

Conversation

@hannahlcameron
Copy link

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class? it allows me to create new instances of that class
Describe an instance variable you used and what you used it for. @terraform_state is an instance variable in my Planet class that holds information about if a planet has been terraformed. I also use it to determine which type of sentence to use as a part of my planet_info.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. I may have done this wrong - I used an array of hashes in my program. I felt like this gave me the bestfunctionality of both - I was able to iterate over the array to print info for each planet while maintaining the ability to have the information by planet kept with consistent labels (keys).
Do you feel like you used consistent formatting throughout your code? yes

@CheezItMan
Copy link

Solar System

What We're Looking For

Feature Feedback
Baseline
Readable code with consistent indentation. Check, well done
Primary Requirements
Created Custom Solar System Class with initialize, add planet & list planets methods, without using puts. Check
Planet Class Created Check
Created a collection of Planet objects as an instance variable in SolarSystem. Check
Accessor methods created Check
Method created to return the Planet's attributes and not use puts Check
Created a user interface to interact with the SolarSystem including adding a planet and viewing a planet's details Check, I left some inline notes.
Additional Notes Well done, you hit all the requirements. Well done.

# initializes solar system
my_solar_system = SolarSystem.new(planet_list)

puts "Welcome to the Solar System 2000, where you can learn information about the planets in the database or you can add in your own planets!"

Choose a reason for hiding this comment

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

It would be good to put this in some kind of loop that would let us to look at a number of planets.


my_solar_system.add_planet(Planet.new("#{new_planet_name}", new_planet_terraform_state, "#{new_planet_temperature}", "#{new_planet_atmosphere}", "#{new_planet_location}"))

puts "You just added #{new_planet_name} as a planet, which located in the #{new_planet_location} galaxy. It is a #{new_planet_temperature} planet, whose atmosphere is #{new_planet_atmosphere} to humans."

Choose a reason for hiding this comment

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

#{new_planet_name} is the Planet instance, not the name of the planet. It's printing "#Planet:0x00007fe7f48a9718" instead of whatever planet name I choose. Instead you should probably use #{new_planet_name.name}

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