Posted by: redlotus April 27, 2010
Login in to Rate this Post:
0
?
Develop a C# console application using four overloaded methods that will return the difference of two parameters in each case. Your methods should contain the logic to return the difference of the larger parameter – smaller parameter, regardless of parameter order. Be sure to test all four methods using different sets of input to ensure that the correct results are returned.
Parm 1 Type | Parm 2 Type | Return Type |
int | int | Int |
double | double | double |
int | double | double |
double | int | double |
The output might look similar to this:
The difference of 30 and 34 is: 4
The difference of 27.35 and 37.70 is: 10.35
The difference of 31 and 37.40 is: 6.4
The difference of 24.28 and 34 is: 9.72
Press any key to continue . . .