Guest User

Untitled

a guest
Feb 24th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. Graduation:
  2. Requires:
  3. variables, data types, and numerical operators
  4. basic input/output
  5. logic (if statements, switch statements)
  6. loops (for, while, do-while)
  7. arrays
  8. pseudo random number generation
  9. strings & string functions
  10. functions
  11. structures/classes
  12. enumerated data
  13. file input/output
  14. pointers
  15. sorting
  16. linked lists
  17. advanced classes
  18.  
  19. Write a program that creates a linked list of bunny objects.
  20. Each bunny object must have
  21. Sex: Male, Female (random at creation 50/50)
  22. color: white, brown, black, spotted
  23. age : 0-10 (years old)
  24. Name : randomly chosen at creation from a list of bunny names.
  25. radioactive_mutant_vampire_bunny: true/false (decided at time of bunny creation 2% chance of true)
  26.  
  27. At program initialization 5 bunnies must be created and given random colors.
  28. Each turn afterwards the bunnies age 1 year.
  29. So long as there is at least one male age 2 or older, for each female bunny in the list age 2 or older;
  30. a new bunny is created each turn. (i.e. if there was 1 adult male and 3 adult female bunnies, three new bunnies would be born each turn)
  31. New bunnies born should be the same color as their mother.
  32. If a bunny becomes older than 10 years old, it dies.
  33. If a radioactive mutant vampire bunny is born then each turn it will change exactly one non radioactive bunny into a radioactive vampire bunny.
  34. (if there are two radioactive mutant vampire bunnies two bunnies will be changed each turn and so on...)
  35. Radioactive vampire bunnies are excluded from regular breeding and do not count as adult bunnies.
  36. Radioactive vampire bunnies do not die until they reach age 50.
  37. The program should print a list of all the bunnies in the colony each turn along w/ all the bunnies details, sorted by age.
  38. The program should also output each turns events such as
  39. "Bunny Thumper was born!
  40. Bunny Fufu was born!
  41. Radioactive Mutant Vampire Bunny Darth Maul was born!
  42. Bunny Julius Caesar died!
  43. The program should write all screen output to a file.
  44. When all the bunnies have died the program terminates.
  45. If the bunny population exceeds 1000 a food shortage must occur killing exactly half of the bunnies (randomly chosen)
Advertisement
Add Comment
Please, Sign In to add comment