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 trial

C# C# Basics Methods Method Parameters

In the C# Basics Code Challenge for Method Parameters, help me understand what's wrong in my Multiply method code body.

Is there something wrong with the code body of the Multiply method?

Program.cs
using System;

class Program
{
    static void Multiply(double firstParam, double secondParam)
        double Multiply = firstParam * secondParam;
        Console.WriteLine(Multiply); 

    // YOUR CODE HERE: Define a method named Multiply. Remember
    // to use the "static" and "void" keywords: "static void
    // Multiply" (without quotes). Multiply should take two
    // "double" values as parameters.

    static void Main(string[] args)
    {
        Multiply(2.5, 2);
        Multiply(6, 7);
        // YOUR CODE HERE:
        // Call Multiply with two arguments: 2.5 and 2.
        // YOUR CODE HERE:
        // Call Multiply with two arguments: 6 and 7.
    }

}

2 Answers

You are missing these little guys { } for your Multiply method

static void Multiply(double firstParam, double secondParam) {
        double Multiply = firstParam * secondParam;
        Console.WriteLine(Multiply);
    }

D'oh! Thank you!