Question: C# program Static Polymorphism -Part 1 Given three integer numbers N1, N2 and N3. Write 2 overloaded functions which perform addition of passed values. Write

C# program

Static Polymorphism -Part 1

Given three integer numbers N1, N2 and N3. Write 2 overloaded functions which perform addition of passed values.

Write two functions inside 'ProblemSolution' class:

Function 1:

solution that accepts two parameters, N1 and N2. A function should return addition of those numbers.

Function 2:

solution that accepts three parameters, N1, N2 and N3. A function should return addition of 3 numbers.

Input 2 3 4

Output 5 9

Where,

The first line of output contains addition of N1 and N2.

The second line of output contains addition of N1, N2 and N3.

Please fill in the partial code below:

using System; using System.Collections.Generic; using System.Linq;

//write your code here

class DriverMain {

public static void Main () { int N1 = int.Parse (Console.ReadLine ()); int N2 = int.Parse (Console.ReadLine ()); int N3 = int.Parse (Console.ReadLine ()); ProblemSolution problemSolution = new ProblemSolution (); Console.WriteLine (problemSolution.solution (N1, N2)); Console.WriteLine (problemSolution.solution (N1, N2, N3)); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!