Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# Given the following code, write a method with the name of DoStuff will return

ID: 3717121 • Letter: C

Question

C#

Given the following code, write a method with the name of DoStuff will return nothing that will take in any class that has the MathStuff method in it will run the Math Stuff function by giving it the numbers 4 and 7 and display the results in a console.writeline public interface ICanWe int MathStuff (int valuel, int value2) public class Firstclass ICanWe public int MathStuff (int firstInt, int secondInt) return firstint econdInt public class SecondclassICanWe public int MathStuff (int firstInt, int secondInt) return firstInt * secondInt;

Explanation / Answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Rextester
{
public interface ICanWe{
int MathStuff(int value1,int value2);
}
public class FirstClass:ICanWe{
public int MathStuff(int firstInt,int secondInt){
return firstInt * secondInt;
}
public void DoStuff(){
Console.WriteLine(MathStuff(4,7));
}
}
public class Program
{
public static void Main(string[] args)
{
FirstClass obj = new FirstClass();
obj.DoStuff();
}
}
}

---------------------------------------------------------------------------------------------------------------------------------------------------


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Rextester
{
public class TestThis{
const string _internal= "Thank you for all the fish";
public static string showThis{
get{return _internal;}
}
}
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine(TestThis.showThis);
}
}
}