An open API service indexing awesome lists of open source software.

https://github.com/truecodersio/method-overloading-exercise-

.NET 6.0 template project for the Method Overloading exercise at TrueCoders
https://github.com/truecodersio/method-overloading-exercise-

Last synced: about 1 year ago
JSON representation

.NET 6.0 template project for the Method Overloading exercise at TrueCoders

Awesome Lists containing this project

README

          

## Exercise 1:

+ Create a method named Add, that accepts two integers and returns the sum of those two integers
+ Now create an overload of the Add method to account for being able to add two decimals together
+ Now create another overload of the Add method that returns a string and accepts 3 parameters: 2 integers and 1 boolean
+ If the boolean parameter is equal to true, the Add method will return the sum of the 2 numbers plus the word “dollars” at the end of the string.
+ You must also account for the appropriate grammar of the string - so it can’t be “1 dollars”

For example:
```
“5 dollars”

"1 dollar”

“16 dollars”
```

[Teacher's Answer](https://drive.google.com/file/d/1eXswxCDzGSArtbqcSoVeB9Tnl-NMzhqz/view)