Johnson Bill

Johnson Bill

  • 1.7k
  • 63
  • 3.3k

I'd like to write reusable oop code in C#.NET which does the following

Mar 9 2022 7:09 PM

I need to write reusable oop code in C#.NET which does the following (just one solution): 
1. counts occurences of a specific letter in a string.  e.g 'l' in "Hello world" => 3
2. counts occurences of a specific digit in a number e.g. 2 in 2546522772 => 4
3. Adds two numbers together. e.g 2+5 => 7

Which is the best way to approach this?  Thanks. 


Answers (1)