Make the following changes to the program in Listing 4.1:
1: | Change the multi-line comments in lines 3 6 to two single line comments. |
2: | Apart from addition and multiplication, allow the user to perform a subtraction. Among other changes, you need to add a Subtract method. (The symbol is used to perform subtractions in C#). |
3: | Instead of calculating the sum and the product of two numbers, make the program perform the calculations on three numbers. (You can ignore the Max and Min functions here.) Hint: You need to declare another int variable in Main. The Sum, Product, and Subtract methods must accept three arguments instead of two. You must allow the user to input a third number, and you must include the third argument when these methods are called. |
4: | Create two methods called MyMax and MyMin that both take three arguments and find the maximum and minimum value of these arguments. Hint: Math.Max(Math.Max(a, b),c) returns the max of a, b and c. |