Consider the following program below.
namespace ConsoleApplication35
{
class OvLoading
{
public string message = "Default message.";
public OvLoading()
{
Console.WriteLine("Hello from C#.");
}
public OvLoading(string message)
{
Console.WriteLine (message);
}
public int Add(int a, int b)
{
int x;
return x = a + b;
}
public int Add(int a, int b, int c)
{
int y;
return y = a + b + c;
}
IT Dip Programmin 3B Page 4 of 6 2nd Semester 2018 Individual Assignment
Memo ver.
© Damelin
public double Add(double a, double b)
{
double u;
return u = a + b;
}
public float Add(float a, float b, float c)
{
float v;
return v = a + b + c;
}
}
class hub
{
public static void Main(String[] args)
{
OvLoading…… (2 marks)
OvLoading ….. (2 marks)
Console.WriteLine("…………………." + ???.???(………….)) (2 marks)
Console.WriteLine("…………………." + ???.???(………….)) (2 marks)
Console.WriteLine("…………………." + ???.???(………….)) (2 marks)
Console.WriteLine("…………………." + ???.???(………….)) (3 marks)
Console.ReadLine();
}
}
}
Result:
Hello from C#.
This is form the constructor with one parameter
Addition of two integers gives: 7
Addition of two double type values gives: 0.9
Addition of three integers gives: 12
Addition of three float type values gives : 1.5
What I have tried:
I'm honestly confused I tried researching but that didn't help. please show me the issue here.