This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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!
 
Sheriff
Posts: 67261
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.
 
Sheriff
Posts: 13479
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.
 
Rancher
Posts: 427
6
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
Rancher
Posts: 427
6
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.
 
Saloon Keeper
Posts: 3255
128
  • 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".
 
Bartender
Posts: 20770
124
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
Sheriff
Posts: 13479
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!


 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!