Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C#. Also, give the code in the format given at the end. Please complete all requirements in the question. THANKS snakenames.txt Coral Ebony

Code in C#. Also, give the code in the format given at the end. Please complete all requirements in the question. THANKS

image text in transcribedimage text in transcribedimage text in transcribed

snakenames.txt

Coral Ebony Jade Leaf Noodles Nofeet Pretzel Sage Slip Slap Slash Slinkster Slinky Slithers Slyder Slyther Squiggles Streak Stripes Sunshine Tangle Verdigris Worm Zippy Blossom Buttercup Cuddles Fluffy Monty the Python Muffy Rumplesnakeskin Serpico Smiles SSSSSam William Snakespeare

catnames.txt

1. Bella 2. Charlie 3. Lucy 4. Luna 5. Max 6. Oliver 7. Chloe 8. Milo 9. Simba 10. Cleo 11. Lily 12. Nala 13. Coco 14. George 15. Gracie 16. Jack 17. Jasper 18. Leo 19. Loki 20. Lola 21. Oreo 22. Oscar 23. Sophie 24. Tiger 25. Angel 26. Bailey 27. Daisy 28. Felix 29. Gizmo 30. Pepper 31. Sebastian 32. Shadow 33. Simon 34. Tigger 35. Zoe 36. Abby 37. Alice 38. Biscuit 39. Boots 40. Buttercup 41. Cupcake 42. Finn 43. Garfield 44. Jasmine 45. Kiki 46. Kitty 47. Lucky 48. Lulu 49. Misty 50. Mittens 51. Molly 52. Murphy 53. Orion 54. Patches 55. Peanut 56. Rocky 57. Romeo 58. Sasha 59. Smokey 60. Stella 61. Whiskers 62. Ziggy 63. Bandit 64. Bear 65. Belle 66. Boo 67. Buddy 68. Caesar 69. Callie 70. Candy 71. Chase 72. Chester 73. Cuddles 74. Dusty 75. Emma 76. Fiona 77. Frankie 78. Ginger 79. Harley 80. Harry 81. Hazel 82. Hunter 83. Jake 84. Juno 85. Maggie 86. Mia 87. Missy 88. Moon 89. Panda 90. Penny 91. Phoebe 92. Princess 93. Ruby 94. Rusty 95. Sadie 96. Sam 97. Sammy 98. Sassy 99. Socks 100. Sylvester
to store collections of these objects in an array and a list, and you will need to perform basic operations on those structures. Required Classes: 1. Class Position, which will have - doubles x,y, and z with setters and getters. These values will be limited to the range +/ 10.0 (i.e., from 10.0 to 10.0 ). If inputted a value outside that range, clamp to the closest value. - Method move() which takes doubles dx, dx, and dz and changes the position by +dx, +dy+dz (it camps to max values of +/100 for the edges). The three values dx, dy, and dz can be positive or negative 2. Class Animal, which will have - Properties: int ID, string name, double age, Position pos. - Methods. Setters and getters for the fields/properties, and a Move method. Move passes inputted (dx, dy,dz ) to the position class (which also will have a move method, the move method in Position should handle the actual implementation of moving things). - Tostring, (public override string ToString())). The Animal class and each subclass will implement its own ToString(), and it should just return off all of the properties in some sane format. 3. Animal subclass: Cat - Enum property Breed \{Abyssinian, British Shorthair, Bengal, Himalayan, Ocicat, Serval\} (if this confused you, look up Enumeration Types on the MSDN1CAreference). 4. Animal Subclass: Snake - Properties: double length, bool venomous. Main method: Note: I deliberately throw a lot of randomness on my assignments to simulate the fact that data can be whatever is. For your development/testing work without randomness or use a fixed random seed so it's always the same, and then test the proper randomness once the regular case works. Generate a series of animals, 6 each of cats and snakes with random properties, use names from the files provided and avoid duplicates, and load them into an array and a list (it can be the same objects in both). [Hint: to use a built-in List you will need to add the following: using System Collections.Generic; Also, you can check the example in Slide 35 of Week 2 material] Traverse each collection (the array and the list) and print off the properties of each object. A foreach loop is fine. This should be a loop with a single line. Move all of the objects with a random dx,dv, dza (but only slightly, these can be +/5.0 but restrict the final position to +/100 ). [Hint: the following code generates and prints five random numbers between 0 and 10]. varrand=newRandom);forrinti=0;i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Generative Artificial Intelligence For Project Management With Aws

Authors: Timothy Krimmel

1st Edition

B0CQV9KWB8, 979-8872627197

More Books

Students also viewed these Databases questions

Question

3. Evaluate your listeners and tailor your speech to them

Answered: 1 week ago