Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLuke Vaughan
15,258 PointsIn Increment.cs create a class named Increment that implements the IUnaryOperation interface. The Perform method should
In Intermediate C# there is a code challenge I am stuck on.
I currently have the following code.
namespace Treehouse.CodeChallenges
{
interface IUnaryOperation
{
double Perform(double value);
}
}
namespace Treehouse.CodeChallenges
{
class Increment : IUnaryOperation
{
}
}
What is missing?
1 Answer
Hannu Shemeikka
16,799 PointsHi,
You are missing the Perform-method inside Increment-class.
namespace Treehouse.CodeChallenges
{
public class Increment : IUnaryOperation {
public double Perform(double value) {
return value += 1;
}
}
}
Luke Vaughan
15,258 PointsLuke Vaughan
15,258 Pointshere is a link to the code challenge. https://teamtreehouse.com/library/intermediate-c/abstraction/interfaces