Implement a coin jar in C# [closed]

Few problems with your implementation:

  • You are exposing both coinage and volume as writtable, meaning I can say coinage = 100000; volumne = 0; and your program will continue as if nothing was wrong.
  • You are requiring the user to calculate volume, don’t make your user do math you can do
  • You aren’t actually allowing the user to tell you enough information to calculate volume. If I call addcoins with and amount of 25 cents, does that mean a quarter, 25 pennies, a nickel, etc.
  • What are the static readonly int values for, and why would you make them an array?
  • Naming, unless your professor said otherwise, you should follow the naming guidelines put out by Microsoft.

I could go on, but this is hopefully enough to get you started on looking properly at what your real requirements are and how you are going to satisfy them.

Leave a Comment