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
- Host: GitHub
- URL: https://github.com/truecodersio/method-overloading-exercise-
- Owner: truecodersio
- Created: 2022-09-07T01:46:25.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T18:10:13.000Z (over 1 year ago)
- Last Synced: 2025-04-07T05:11:15.279Z (over 1 year ago)
- Language: C#
- Size: 130 KB
- Stars: 1
- Watchers: 2
- Forks: 396
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)