Advertisement
gpric001

CS 12 SI w5_L

Feb 10th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. Problem 1: Random selection in an array
  2. ---------------------------------------------------------------------------------------------------------------------------
  3. Design a function to randomly return a string from an array of strings.
  4.  
  5.  
  6. Problem 2: Hiding text
  7. ---------------------------------------------------------------------------------------------------------------------------
  8. Design a function that returns a string consisting of alphabetic characters and underscores based on an array of characters
  9. that should be shown. For example, if the word to be guessed is "hello" and
  10. the user has guessed the characters 'e', 'l' and 'g', the function will return the string "_ell_".
  11.  
  12.  
  13. Problem 3: Selecting file input based on length
  14. ---------------------------------------------------------------------------------------------------------------------------
  15. Design a function that reads in a file of words (with each word on one line) and writes the words with length greater than
  16. or equal to n to a new file (n is user defined).
  17.  
  18.  
  19. Problem 4: Reading a file into an array
  20. ---------------------------------------------------------------------------------------------------------------------------
  21. Using your solution to Problem 3, design a function to read in all words with a length greater than or equal to 6 into an
  22. array.
  23.  
  24.  
  25. Problem 5: Hangman
  26. ---------------------------------------------------------------------------------------------------------------------------
  27. Using your solutions to Problems 1 through 4, implement the game Hangman.
  28.  
  29. Use the following command to get a text file of words to try with your game:
  30.  
  31. $ git clone https://github.com/gpric001/SI_CS12.git
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement