• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Please help with C# interview task  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a console program in C# to print out 5 verses of the song “Old MacDonald Had a Farm" with 5 animals of your choosing.The verse is repeated for each animal and the appropriate sound for the animal is used eg cows go “moo”, ducks go “quack” etc.?
Here is the song using cow:
Old MacDonald had a farm, E I E I O,
And on his farm he had a cow, E I E I O.
With a moo moo here and a moo moo there,
Here a moo, there a moo, ev'rywhere a moo moo.
Old MacDonald had a farm, E I E I O.

Please provide two solutions if you can, one using polymorphysm and one with data-driven approach!
 
Marshal
Posts: 67257
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No one here is going to do your work for you.
 
Marshal
Posts: 13447
222
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Asking help for an interview? Wow. If I were the employer, this would be grounds for instant disqualification.
 
Ranch Hand
Posts: 380
2
Fedora IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need help with that, what are you going to do if you do get the job.
 
Al Hobbs
Ranch Hand
Posts: 380
2
Fedora IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you do polymorphism approach then the sounds would be hardcoded.  The data-driven would be like if you got the information from a file or database.
 
Master Rancher
Posts: 3189
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the earlier replies, one might be forgiven thinking that the adage here is "there are no stupid answers, only stupid questions".
 
Saloon Keeper
Posts: 20655
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applicant rejected. Didn't bother to read basic instructions on how to create a Coderanch account name. Sloppy worker.
 
Junilu Lacar
Marshal
Posts: 13447
222
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Piet Souris wrote:Looking at the earlier replies, one might be forgiven thinking that the adage here is "there are no stupid answers, only stupid questions".


It's blatant dishonestly that is not tolerated well around here.

OP wrote:Please provide two solutions if you can, one using polymorphysm and one with data-driven approach!


 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
ScroogeXHTML - the small and fast RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!