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

Create random-menu.rb #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jessiezhang2017
Copy link

@jessiezhang2017 jessiezhang2017 commented Aug 7, 2018

Random Menu Generator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
For the places where arrays were used, could using a hash work? Could it work easily? Why or why not? We can use a hash to replace the array. I don't think it will work easily, since we need to set up a key and a value pair for each item in hash, while in array, we already have the fixed index. so it is easy to search data in array than in hash. this project ask for avoid duplication in the output, it will need to write more codes to accomplish if we use Hash instead of array.
Did you find repetitions of the same or similar code? Why did you have to do it that way? Yes I do . I set up three arrays in the program. Each array need user inputs. The three while loop I used to ask for user input is similar. I might can use methods to remove the duplicates.
Did you use any loops? If so, how did it help solve a problem? Yes I used while loop to repete asking same questions. and use times loops to print each menu items. the loops helps to reduce duplications in the codes

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