Skip to content

Conversation

@Abiaina
Copy link

@Abiaina Abiaina commented Feb 6, 2018

Mood Analysis

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Would a hash work just as well as an Array in this project? Why? Yes, but I would have to make the keys numbers( 1 to n..where n is the number of items the user desires). And then I would call them by randomly generated keys in the range of 1 to n. But, I wouldn't because it probably makes the code more complex. Its not important to show any particular relationship using the above logic. But, I could also make a hash with key value pairing based on the type of descriptors and make hash out of 3 arrays. Again, this seems overly complicated but I guess I could make it work by accessing each descriptor array from the hash by its key (descriptor, cooking_style, and food) and then modifying the returned value that is an array.
Did you find yourself repeating the same code? Why did you have to do it that way? Yes, I did. I had to do that especially in the section when I was checking people's responses and offering them another chance to modify them if the values would not work with my program. I did it that way because I did not want to have too many functions in the program/loops if the same thing could be done with a few lines of code. I made a method of anything I had to repeat a lot and making a method made it easier for me to write the code (at the time).
What type of loop did you use? Why did you choose that type? I used a couple of loops. I used a .times loop to allow the user to vary the number of items in the menu. I used this because it allowed my program to be more responsive to the user. I also used a .each to loop through the list of descriptors of the food. I chose this type because I could call all the descriptors in one line of code and add them to an array that my function I used it in used as a parameter.

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